I'm using Graphene OS on my phone. A few days ago or so I stopped hearing notification sounds. The sound is working, the notifications settings haven't changed. I noticed that when I unlock my device, it connects to the internet and I receive notifications then. It used to be that I'd still get notifications and hear the sound while the device was locked.
I don't know how to debug this. It seems to be related to internet connection somehow, since the notifications are received when I use and unlock the device after leaving it alone for a while. It happens when I'm using Wifi or connected to my mobile provider's network.