I'm sorry that happened to you. Like Devlyn Marie said, extremely inappropriate – but sadly not surprising. I had one doctor, who mainly did trans-related healthcare, use the wrong pronoun for me
during a HRT consult. It's funny now, but was very discouraging at the time.
In fact, I've had several trans-focused providers (and their staff) say all sorts of ignorant things. They're often the only game in town, so many patients don't feel like they can speak up.
On the other hand, I've had several wonderful doctors who knew absolutely nothing about transgender healthcare be very considerate about pronoun usage, including my former gynecologist. At a time when I was rarely read as male. So, yes, people
can get it right, even if they're intimately involved with your below-the-belt region.
They just need to, y'know, try harder.