It's a server side bug. When you jump then right on a bed to sleep, you get disconnected with "Flying is not enable on this server"
Maybe the server do not detect you're sleeping and with the jump think you are flying.
CraftMarine
Related issues
Comments

Thank you for your report!
However, this issue is a Duplicate of MC-114544.
If you have additional information, please add it to that report.
Please search before reporting, as it's likely that one exists already.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki