This happened at a local leisure centre.
When I first joined, I enquired as to the location of the women's showers. I was given directions to them, but was told that I was also able to use those adjacent to the pool, since there are only a very a small number in the gym changing rooms.
The member of staff then hesitated and made a point of telling me that those in the changing village are unisex. [I'm trying to recall whether there might be a part of the area that's single sex, but I genuinely can't remember.]
I've used them once. They were okay, though the cubicle walls don't go all the way from floor to ceiling - there's a sizeable gap at the top and it looks as though the bars at the top have been fitted retrospectively. I did wonder at the time.
While I was there, the only issues were young men swearing loudly while mums were in with toddlers and a young man with learning difficulties having to be told by his carers that he couldn't keep shouting "I can seeeeeeeee you!" [The lad seemed harmless, but definitely needed the accompanying supervision.]
I stumbled across this today. It only happened this year, so I'm assuming it's not the first since I joined the gym about three years ago.
I'd say that the only solution is to have legislation which dictates that unisex areas are only for adults with children and for adults with carers.
I know that they can't have the doors ceiling to floor for health and safety reasons - I'm aware that there was a situation where a disabled gym user had a fall and was left for a while before anyone realised what had happened. (There's only one accessible shower in the gym area that I'm aware of.)
https://www.thecourier.co.uk/fp/news/courts/5581014/friday-court-round-up-pool-peeper/