When you sleep and start spamming messages in the chat area on single player, it will say Disconnected by Server: disconnect.spam. The game will then take you to the multiplayer screen.
Linked issues
Attachments
Comments
Duplicate of MC-14923, please use the search function to see if your bug has already been submitted. Currently over 52% of tickets are being closed as duplicate.
From the looks of this its intended to do that.
Also how is this a bad thing?