I have had this happen overnight too - when there are no apps open and the phone, on the surface, is idle. Very irritating as the only way I find out is when the alarm doesn’t sound. A reboot is the only fix for me.
I’m starting to wonder whether a lot of things on my phone that just ‘die’ periodically (all sound, Bluetooth, Office365 account synchronization) could be down to the same core issue - out of memory?