At a youth hostel, I was given a bed in a men's dorm (though I didn't realise till morning, as no one was around when I went to bed, and I slept well, but it could have gone differently.) I got a full refund and a huge apology in the morning. I'm pretty sure I look female, and my name is female, so there should not have been confusion. It is no longer a youth hostel, I noticed last time I was up that way.
Last year, I was spending one night in a city hotel. It was cheap, so I not expecting more than a bed , loo and shower, but the bathroom light wasn't working, so the proprietor just got the bedside light and led it round the doorway into the bathroom. The shower itself was barely functional, the floor was badly stained, and a small window was badly cracked. There were also holes in the curtain. I shopped them to the local Environmental Health, who called me after the weekend for more details. Haven't checked if they're still in business.
If I book somewhere cheap, I don't expect luxury, but I do expect clean and safe and compliant with legal requirements.