Force a Player out of bed on a certain night?

Ok, basically, I can't run mods too well on my computer and would prefer using command blocks. There is a mod I want to semi replicate where on a random night, it will tell the player "This is not a normal Night...", and if the player tries to sleep, they will sleep for a second then be forced out of their bed, where some over powered zombies will spawn. I know how to spawn the zombies and how to test if the player is sleeping, but apart from killing them I don't know how to remove them from their bed.
Best Answer
As of Minecraft 1.13.1, it is now possible to simply /tp
the player to be not touching the bed, whereupon they will stop sleeping.
Pictures about "Force a Player out of bed on a certain night?"



How do you make it so that one person sleeps in Minecraft?
There is no need to actually stay in the bed. All that matters is that you actually were laying down. So rightclicking on a bed and getting the message "you can only sleep at night" does not set your spawn. Getting in the bed, and immediately back out sets your spawn.Do you have to sleep in a bed to set your spawn?
If a player's bed is destroyed or the bed is surrounded by solid blocks and the player dies when the player had set his spawnpoint there, a message is displayed saying Your home bed was missing or obstructed, and the player will respawn at the original spawn point.David Guetta - Play Hard ft. Ne-Yo, Akon (Official Video)
More answers regarding force a Player out of bed on a certain night?
Answer 2
Ok maybe this will work do /testfor (Name) at the x y z of the bed and use a comparator and connect one to an another commandblock and do /say this is not (Name) and the bed will disappear you can make it disappear by adding another command block and use /setblock x y z air then add two repeaters and delay it to its maximum and add another command block and use /setblock x y z bed and your done hope this worked
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Charlotte May, Ron Lach, Charles Parker, Charles Parker