The sales clerk was unprofessional. You are a paying customer with no intention of shoplifting, so her job was to help you select the items you wanted. Part of that is trying them on.
When I was presenting male, I'd choose items off the racks and take them to the men's fitting rooms. The general rule is the same as for bathrooms: use the one that matches your presentation that day.
One exception for me was bra shopping one time. Unsurprisingly, there was no men's fitting room in the lingerie section of this particular store, so I used the only fitting rooms available. My wife helped me, and we managed to fend off the sales clerks, which minimized the chance of being hassled. I only got one dirty look from a customer. The fitting rooms were in a corridor by themselves, and each cubicle had a full door, so there were no privacy concerns.
In another store, where there were men's and women's fitting rooms side by side in close proximity to the lingerie section, I'd take my selection of bras to the men's fitting rooms. Yes, a bit awkward, but none of anyone's business, as long as I have the money to pay for them. If anyone had given me a hard time, I'd have told them the truth. It's nothig to be ashamed of.
Things are a lot less stressful now that I present as female all the time. There are no issues with fitting room selection any more.
Some stores even have ungendered fitting rooms. The local outlet of a national second-hand clothing chain has a row of 8 undesignated fitting rooms. You just use the first one that's available. It's no big deal.