I have experienced that for a long time and is still not fixed.
when I’m connected via Bluetooth ( speakers or headphones) and Spotify on the background, sometimes I lock my phone and after that if got one notification or if I touch the display, the display doesn’t turn off anymore. I did already looked at the iPhone settings but I cannot solve that. I noticed already that just happens with Spotify. To fix I have to close the App completely.