On the move so couldn’t respond until now.
OK this is a very good question to answer as it shows the answer is to do with the environment that is created around the toilet cubicle.
Firstly, obviously, would anyone know about hormones or surgery? You must know that can’t work practically.
Secondly, there have been men that said they are women at the time of being in the women’s toilet and have committed crimes. But they were prosecuted as men as they were back to identifying as men at that point. There have also been men who identified as women during the crime in the women’s toilet, and whilst after it, and were prosecuted as such.
As for being prosecuted for using toilets for sanitary purposes only (what they are there for) then leaving. People who are on SHPOs can be reprimanded for using the toilet in the normal sense, because people are often banned from using particular design of public toilets, when they have committed offences. They might have an order that lasts several years - in can be 15 years or more.
So that’s the usual way men (it’s always men) would get in trouble for using the toilet in the normal way. It could be a women’s toilet, a unisex toilet or (very unusually) a men’s urinal. However, irl it usually is because they reoffend and it gets picked up that they are breaking the conditions of their SHPO.
I am pretty confident no other man or woman has been prosecuted for using the wrong sex toilet for sanitary reasons. I think the lawyers in recent cases would have referred to that. Why would this situation go as far as prosecution? Would that be a good use of time and resources when there’s so much else going on? I know for the consultation for Document T most of responses cited Stonewall. When you look at the report they referenced there was anecdotal evidence of a transwoman saying they have been verbally abused and physically abused by women. This was being shouted at to get out the ladies and then two women then tried to push the transwoman out when the transwoman shouted back and refused to leave. No one was prosecuted as far as I know. The consultation answers were so focused on gender that the analysis threw up some nonsensical results - there seemed little support for disabled people having safe toilets or boys safety.
The prosecutions data I have got are for men sexually abusing women and children and occasionally other men in toilets and also for men being voyeurs (including the increase in hiding cameras which is also a male crime). I would always recommend male and female toilet cubicles have floor-to-door gaps and space above a standard height door as this is a preventative measure against crimes happening. It also aids supervision in the event of a medical emergency, and assists cleaning and ventilation.
Perpetrators don’t like witnesses. Purpose built ‘gender-neutral’ cubicles don’t have door gaps because everyone seems to agree they don’t work in a mixed sex environment. But then look at this in conjunction with other data. For example, in schools various reports (BBC, Channel 4, Ofsted, Everyone’s Invited, Academic studies) put sexual assaults at high levels. Rapes have even been said to be reported at a rate of between 3 to 5 per school week - though no one seems to be looking at this and finding out true figures. As an ex-teacher this is horrifying. If you have a look at where this is happening inside a school it has to be in places where both sexes can legitimately have access and can’t be seen. And these are the numbers reported - not prosecuted. That’s very different.
I maintain most men and women are good people, it is irrelevant how they identify, and if they witnessed something bad happening in the toilets they would assist the victim or get others to help. But in mixed sex toilet environments, that’s more difficult because of the design.
So do you see why single sex toilets are so important yet?
(edited to make it clearer hopefully).