The bug
When trying to sleep in a bed in the nether (or the end) that is occupied by a villager, the bed explodes. This might be intended.
To reproduce
Go into the nether or the end
Place a bed
Spawn a villager
Run
/time set midnight
The villager will go to sleep (MC-146515)
The bed won't explode (MC-145964)
Try to sleep in the bed
❌ The bed will explode
Original description
Set time to midnight using /time set midnight.
Spawn a villager in the overworld, next to a bed and worksite block. Villager gets its profession and gets into bed. Bed blockstate changes, and bed is marked occupied. Players cannot enter the bed.
Navigate to nether (I used /execute in... & tp); repeat the process. Bed still changes to the occupied state. Villager does not cause a bedsplosion. If a player attempts to enter the bed, bedsplosion occurs.
Expected outcome:
Either villagers should cause a bedsplosion in the nether, or players should be blocked from causing the bedsplosion when a villager is in a bed in the nether.
I assume this same behavior is exhibited in the end.
As MC-146515 has been resolved as "Works as Intended", I have rewritten this report so that it now only is about the player being able to explode the bed even though it is occupied by a villager.