Mjarr replied to Killed in sleep, mob at bed. Help ? January 5, 2022 @ 3:46:45 pm PST
They do not spawn indoors though, they spawn outside the ring and move inwards.
Spawning indoors is irrelevant given the game is still running and doing its thing as you are going to sleep, and if there was open door and insufficient workbench coverage while there is x-seconds of time the player is unable to do anything due fading in black, seeing whatever sleep message there is and whatnot while everything else in the game is free to move and do whatever they will, it is perfectly possible to find indoors swarmed with enemies as you wake up.
You are free to replicate and verify that in separate seed with help of console commands and debugmode. Not saying such scenario is common but it is technically possible.
12:19 am, January 6, 2022