I disagree about it not being remotely comparable. There's little doubt that on average it's gonna be far worse to misgender a transperson in that way (though "i thought you were x when i first met you" isn't really misgendering either since it's explicitly saying they're not that, but w/e we all know what we're talking about here) since there's a very high chance they have some degree of trauma associated with it.
But I think in individual cases the "i thought you were gay" can be just as bad, so I do think it's entirely comparable. I think it's important to also think about the worst effect it could have, and it's such an unnecessary action that both cases are just toxic and never a good thing, so I don't think there's a need to rank one as worse than the other. (And ofc both can also be fine if it's clear everyones comfortable with it, and that's more likely in the gay case, but hopefully that's obvious).