I had this problem as well. I think it has something to do with charging. I don't charge over night so i can see the bug some times.
When the phone reaches it's battery limit, does not matter if you've set your own (I set it to 80%), some times the phone restarts on his own. When this happens alarm clock and some other features don't work anymore. The phone gets slow and at some point hangs up completely. It isn't a real restart there is no boot animation, it just asks for your sim pin.
After that you can easily solve this by restarting the phone on your own before it completely freezes, at least when you don't sleep

At the beginning when i installed the rom, I missed my alarm clock a few times and it freezed often until I saw the uncomplete reboot and now I just restart it when it begins to act ****ty