If a player sleeps in a bed that has a lantern two blocks above it, the player will sneak while sleeping.
Minecraft 19w40a 2019-10-02 17-47-02_Trim.mp4
When you sleep under certain blocks, you sink into the bed
Incorrect player position in bed below other bed (bunk bed)
You can sleep inside a bed while sneaking on client side