It is only me that is confused.
It is only I that am confused.
The first one sounds more natural to me while the second one appears to me as grammatically correct. Which one is correct?
This question is as much about what form of the first person singular personal pronoun should follow ‘It is . . .’ as it is about the form of the subsequent verb be.
The normal response to a question such as ‘Who’s there?’ is ‘It’s me.’ However, when, as here, the clause is modified by a relative clause, I loses the formality it has in the response ‘It is I’. Thus, ‘It is only I who am confused’ is unexceptionable. (I have substituted who for that to avoid clouding the issue over the choice between the two.)
The question remains whether ‘It is only’ can be followed by ‘me’, and, if so, whether is or am is the appropriate form of the verb. I think the answer to the first part is that it can be, and that the answer to the second part is that the most likely form of the verb is is. That seems to be because me doesn’t expect am in the way that I does. But use ‘It is only I . . .’ and there is no further choice to be made.
As in many of these cases, it really depends on what you mean by "grammatically correct".
As you point out, the first version would probably be judged as sounding more natural by most native speakers. So it is certainly grammatical or "correct" in that sense.
Now, irrespectively of what sounds natural, some speakers aesthetically prefer (or have been taught to aesthetically prefer) the second version, at least in formal writing. Subscribers to that rule would probably also use "who" rather than "that".
So, the second version is the "correct" version if you subscribe to a rule that artificially demands this form. But it's really up to you whether or not you decide to subscribe to that rule: it's just an artificial invention at the end of the day. (It's also worth noting, as with most prescriptive rules, that the argumentation behind it is essentially nonsense...)