“Oh, sorry, I didn’t know you were disabled/gay/trans/etc” isn’t an excuse or an apology. Instead of forcing people to out themselves, your language should naturally not be harmful or offensive.
when someone points out something problematic in your behavior and you say, “sorry, i didn’t know you were x,” what’s implicit in that apology is “i wouldn’t say this around you, but i would if you weren’t here.” that’s not allyship, that’s just keeping your bigotry under wraps.