There are 2 ways to resolve this that have been discussed by WOTC designers in an official capacity: An older option on a Sage Advice segment of one of their Dragon Talk podcasts from January 2017 (specifically at about 13:12 for ~7.5 minutes), and a newer optional rule provided by Xanathar's Guide to Everything's Dungeon Master's Tools chapter.
Sage Advice: Intent is that spell effect doesn't happen, action cost applies, and DM judges whether spell slot is used
To summarize Jeremy Crawford's statements in the January 2017 podcast, "illegal targeting" is a gap in the written rules (as of the date of the podcast) and it's mostly open to DMs to choose how to handle it. That said, Crawford says the intent for how it should be handled is that the spell should still take up the casting time but the spell effect will not occur and not consume a spell slot (I.E., option 2 listed in the question).
There are enough corner cases with this solution at the time of the podcast that Crawford still recommends that a DM adjudicate each individual occurrence on a case-by-case basis until there is eventually an official printed rule. As an example of why, he says spells such as those which require a spell attack probably should still consume their spell slot since there'd be some dissonance with the fact that those spells can miss, unlike saving throw spells which always "hit" but the target can resist their effects.
(He does not clarify what should happen if something like Eldritch Blast, which targets only creatures, actually hits a non-creature in this case.)
The flavor reason for this is that he views spells as essentially trying to make a magical connection between the caster and target. When that connection is established, the energy of the spell is consumed in producing the spell's effect - but if the target isn't one the spell can make a connection to, nothing happens and that energy isn't expended.
He views spell attack spells as a different category; if I had to guess why, it's likely because they mainly produce some effect that then follows standard attack rules in trying to reach the target.
Xanathar's Guide to Everything (optional): No spell effect, action cost applies, and spell slot is expended
As of Xanathar's Guide to Everything's release in November 2017, the (optional) rule for resolving invalid spell targets states (p. 85-86):
If you cast a spell on someone or something that can’t be affected by the spell, nothing happens to that target, but if you used a spell slot to cast the spell, the slot is still expended. If the spell normally has no effect on a target that succeeds on a saving throw, the invalid target appears to have succeeded on its saving throw, even though it didn’t attempt one (giving no hint that the creature is in fact an invalid target). Otherwise, you perceive that the spell did nothing to the target.
This is in slight contrast to Crawford's earlier statements on the topic above, in that the spell still occurs and consumes a spell slot with no apparent effect.
The Ring of Spell Turning states:
In addition, if you roll a 20 for the save and the spell is 7th level or lower, the spell has no effect on you and instead targets the caster, using the slot level, spell save DC, attack bonus, and spellcasting ability of the caster.
So this means, the spell does not originate from you even when you have returned it, but instead you merely redirect the target. This means that it is as if the cleric used command on themselves using the word "Flee."
This is the effect of the "Flee" command word:
Flee. The target spends its turn moving away from you by the fastest available means.
Therefore, the cleric is commanding themselves to flee from themselves. This is a contradiction -- you cannot possibly move away from yourself. However, the command spell also stipulates:
If the target can't follow your command, the spell ends.
So in this case, the spell would end immediately, since the cleric cannot follow their own command.
This also means that if the spell had a concentration requirement, such as polymorph or banishment, they can willingly end concentration because it is still their spell, they just shot themselves with it instead of you.
Finally, the Ring of Spell Turning cannot return a spell that does not target only you. If command was cast at a higher level such that it targets you and someone else, then you cannot return it. You would also not have advantage on the saving throw.
Best Answer
The character only Grovels on a 9-10 roll
Spells only factor in potency when they are the same (emphasis mine):
Instead, both spells affect the target regardless of possible potency metrics such as timing, spell level, or spellcasting modifier:
This means that regardless of your command...
Any other activity (such as falling prone) would be considered behavior, and as such could not be done if the d10 roll decides a specific behavior before the creature has the opportunity to act on your command. Command then ends if the creature is unable to Grovel.
Confusion takes priority because it takes effect at the start of the turn, before the creature can decide it's own behavior (and thus decide to follow command). If multiple effects trigger at the start of your turn, the GM would have to decide the order unless there is specific guidance on the text. In this case, though, command only specifies "on its next turn", so the more specific trigger has priority.
TL;DR
On a roll of 1-8, it's behavior for that turn is defined by confusion. It doesn't have an opportunity to fall prone since that would be a different behavior.
On a roll of 9-10, while "acting normally", the creature will fall prone and end its turn per the command.
If the GM instead decides that the effects happen simultaneously...
... Xanathar's Guide to Everything (XGtE) provides a suggestion as guidance in the Dungeon Master's Tools section:
I worked from the assumption that confusion triggers first, but I've seen arguments that the effects are simultaneous despite the differing wording.
Under this ruling and using XGtE's advice, the GM would directly decide which happens first (the creature falls prone and ends it's turn or rolls for confusion) since the GM controls the NPC.