Is this sentence correct grammatically?
Could they confirm which account they have refunded to?
Grammarly picks that it is incorrect but not sure why it is incorrect?
A question can be written in more than one style.
As far as Grammarly is concerned, I know that tool quite well (have been using it for years). The problem it might have with this is the sentence ending with preposition.
IMO, this sentence conveys the message well. So, it's okay.
Don't try to pass your post through Grammarly with 100% corrections. At times, it's not possible. For instance, Grammarly does not favor passive sentences. Now, that does not mean that the sentence is incorrect, does it?
For me, Grammarly complains about
Possibly confused to and too
(for next time: you should have mentioned this in the post!)
That's enough reason for me to uninstall it right away. With 'too' the sentence becomes incorrect.
While it might sound strange, it is perfectly valid to end a sentence with a proposition. Other examples of this are 'What are you looking for?' and 'What solution have you thought of?'