There are cases of trans-identified men being prosecuted for the acts they've committed while in women's spaces.
But this isn't necessarily about prosecuting trans people (although I'm sure there is the capacity to do so if someone was to insist on accessing a space that wasn't for them). It's about the PROVIDERS being prosecuted - the organisations with court bills and fines to pay as a result (which may well not be covered by any insurance) which would adversely affect their businesses (always assuming they didn't either go bust or lose a necessary licence as a result).
So ultimately it will be in the interest of those providing the facilities to ensure everyone is only using the facilities for their biological sex. Because the alternative is financial penalties, reputational damage and so on.
As for not changing anything, the code might not be policed but it will be enforced. We will make sure of that.