I had the same issue. Game crashed not only when going to sleep but opening the chat too.
In my case MineTogether mod was the issue (if you sleep => game tries to open MineTogether chat and 50% of the times crashes) . Simply removing it from 'mods' folder solved the problem.
I hope this helps.