The definition of a bedroom is as much a legal one as a practical one. To be a bedroom on a floor plan filed with your city/county/whatever there must be an egress window. Just because there's no egress window doesn't mean you can't put a bed in that room. If someone dies in the room because they were sleeping and a fire trapped them there then that's on you, the government warned you on best practices for fire hazards but it is up to you on following them in practice.
It's pretty common to see floor plans for apartments and houses that have what is obviously expected to be used as a bedroom but because there's something preventing the placement of an egress window they will be called an office space, bonus room, storage room, play space, just anything but a bedroom.
I've seen this happen many times, a room without an egress window used as a bedroom. People recognize this risk and so they tend to put some able-bodied person in that room. That's the room for Grandma or the teenage child as opposed to the baby of the family. Egress windows aren't just for getting out, it's also for someone from the outside getting in. If that bedroom is for some infant then the large window is to allow a firefighter to break in and pull people out.
Does a bedroom need an egress window? Legally speaking that will be the case for much of the world. Practically speaking, no, you can put a bed anywhere you like and the occupants of that structure are free to choose to sleep there any time they like.
Personal experience tells me that if there's only one door out of some space then put in a flimsy door that can be busted with a swift kick. I found myself locked in my own basement bathroom because the latch jammed up from age and wear. I wasn't in any immediate danger of a fire or anything but I knew that there was not likely to be any other way out but breaking the door, so I broke the door. It was a flimsy door so not a big effort on my part to defeat it and make a safe exit, but had it been something more substantial then I might have injured myself from breaking the door or busting through drywall as well as created repairs that cost me more than a new door. Had there been an egress window in the bathroom then I'd simply have crawled out the window then used the keypad lock on an exterior door to let myself back in the house. The door might still have needed to be broken to resolve the issue since that latch was bound up tight, but at least I wasn't breaking myself in the process of breaking the door.
An interesting bit on fire code that might be relevant is a code inspector told me no rooms in the house requires an interior door but bathrooms. If there's just a curtain or something similarly insubstantial separating the bed from the egress window then the "bedroom" could be that entire space that includes the family room.
I don't know if I answered the question but I believe I offered food for thought.