My wife is a stroke survivor and her balance has deteriorated such that it is just too easy for her to fall and get hurt. Public bathrooms are a struggle. We pick male or female depending on a number of things, like is one less busy, does the womens room have kids in it as I wont go into one if there are, etc. Women dont seem to get hung up about me being in their bathroom and I make sure they know I am there. In fly over country, if we pick the mens room, men will queue at the door to respect her privacy, which really touched me that there are still men In this world that would do that. I guess I am saying sometimes genders need to be in the others bathroom, as uncomfortable as it is.
I’d need a warning to get out of the bathroom before you came in. It wouldn’t be acceptable for you to just announce that you’d arrived. I’m perfectly willing to accept that a bathroom closes off for you and your wife, but not that you go into one without giving other people the opportunity to leave.