I agree with V.
An experience that is sad to read about, and I'm sorry you've been dealing with it. I hope you can put things back together.
But as you say, the crisis was about homelessness. You met a doctor who was a bit rude - so what, in the grand scheme of things - he's never met you before, and he works in psychiatry, so he's no doubt dealing daily with people who say they are everything under the sun which doesn't match their actual name or the details he's been provided with.
You needed to go to emergency to stop a crisis from getting worse, and to find a safe roof where you could eat, sleep, not come to physical harm, and get access to help for going on. That was achieved.
The most important thing is that you're safe, and not on the street. That would be infinitely worse than a doctor not using the correct pronouns until another professional arrived to say 'actually, stop that'.