I have done it twice. Both were intentional though, well, sort of. The first time was at the gym. I was going into the Mens locker room when I saw a sign sitting at the door saying that the men and women's locker rooms had been switched. Going over to the women's locker room, I saw the same sign and proceeded to walk in and use the restroom. There was no one in there though. To this day I don't know what was going on, if someone was just having a laugh or if there was some reason behind it.
The second time was at a restaurant A Five Guys I believe. We had been in the car for hours and I REALLY had to go. The men's room door was locked. I knocked but didn't hear anything. Trying to be polite I waited for a bit, but in the end, I just couldn't and went into the women's room. It was one of those single toilet bathrooms. I didn't think anything of it until I walked out and saw a lady with her two daughters looking up at me, shocked. I just kind of, smiled, waved, and walked out.
No harm no foul. Still pretty weird though.
"You're going to fail a lot. Sometimes you'll fail over and over again, but you have to keep trying every time. You can't give up just because there is a chance that you might fail." - Dante Basco