OP, truly, this wasn't about your appearance. Two issues - 1) the myth that we can't discern sex, and 2) the forced conflation of external appearance of femininity with femaleness - are currently compounding women's insecurities. And understandably so - particularly when you're clearly a lovely person yourself, so are desperately looking for a rational explanation of why the heck someone else would have behaved this way towards you (it sounds awful).
And we can't begin to know that. But what we do know, for almost certain, is that 1) above means they were in no doubt at all that you were female (I mean seriously, how many 5 foot 3 European men have you ever seen? how many times in your life have you not been able to sex someone yourself? - for me, I think it's maybe twice?), and so 2) above is an irrelevance anyway! It simply wasn't about your appearance as a woman. It just wasn't.
It was all about shouty-woman's issues! (Maybe her own insecurities? So often the reason for bullying behaviours).
I won't post again as I don't want to derail your thread, but I desperately hope the current poisonous concept of pretty-passports for single-sex spaces will die down. It's not yet a thing, and it doesn't have to be one, unless me make it so by accepting the idea and letting it influence our thoughts and behaviour.
99.9% of the time, women can discern sex. Perhaps .1% of the time, we can't, OK. But far, far higher than that vanishingly unlikely .1% of the time is the depressingly high probability of encountering angry, insecure, bullies or total weirdos in public spaces! This was the issue here, OP. You were unlucky.
I wish you happy gym-ing in the future. You'll get back to it - you're clearly a far stronger person than me in that respect, gym-wimp that I am!