Some info: In the old Minecraft Launcher for OS X, there is a red bar at the top asking you to download the new one, with a clickable link. However, if you click anywhere that's not a button or the news/log/profile editor, it assumes you meant to click the link and opens your browser to download it. I know there's a similar red bar on the Windows version, however I do not know if the same bug is present. I'm also not sure it would be a high priority to fix (if at all), because, well, it's the old launcher.
Can confirm for 1.8.8.
This bug has only ever happened to me once, and that was playing a custom map. I had been playing for over an hour, and hadn't slept in a bed before then. I also hadn't used any elytra, nor were there any trapdoors around. When I sleep there again, the bug does not occur. The one time it did happen was in 1.9.1, though it shouldn't have been fixed by 1.9.2. A screenshot of the bed area is attached.
EDIT: Removed the horribly large picture, find it in the "Attachments" section instead