I believe that the iPhone is actually respringing when that happens.
It happens often when im listening to podcasts or music, I turn off the screen and the audio stops, the screen stays black no matter what I do for a few seconds until it turns on by itself and I can go start my music again.