This is a Bug I found in all Versions of Minecraft Such as The Latest Snapshot for 1.14, 1.12.2, etc...
This Only Happens When the Bed isn't too far from the Roof (Only 1 Block as you See in Picture 1).
Sleeping on it causes to Both See Inside the Building and the Outside! (Picture 2)
After Waking up, I'm on my Building Roof and I try Jumping but I'm STUCK in that Block, So I have to Fly or Break that Block. (Picture 3)
Related issues
relates to
Attachments
Comments

[media][media][media]

This happens to me too. It has only been happening since 1.8.1 for me

Cannot reproduce in version 19w46b