Jeez, why would anyone want people routinely prosecuted for a one off of trying to use the wrong toilet?! That's another corndolly, Petrol.
I'm sure 'politely but firmly directed to the correct toilet' would suffice, unless they were, in fact, committing some sort of offence, such as voyeurism or indecent exposure.
I'm an ex pub landlady. Blokes in the ladies, whether they've drunkenly bumbled in by mistake, or just wanted to check their eyeliner in the naice mirrors...not an uncommon event.
Generally leave apologetically when challenged. The ones that don't, are a problem.
Males who identify as women - sorry, not women's problem to accommodate. They can also politely be asked to use the correct facilities, ie the gents, as the law clearly expects & provides for.