I'm using KitKat stock on my Xperia Z. Previously using Google Play Music and lock screen controls worked fine. Now, if I pause Spotify using the lock screen, the widget will always disappear from lock screen after a few minutes of screen off.
I imagine that Spotify is sending some form of sleep signal to the lock screen?
For reference, I recently updated my Zenfone 2 from Android L to M and this problem started happening after the upgrade.
Spotify will be playing songs normally, but the lockscreen controls disappear for no reason. Never happened while using Android L, thought. Now, it's a frequent issue. The persistent notification controls are also missing when the issue occurs.
I also noticed that it affects other applications that try to control spotify, such as Pebble or AutoMate Car Dashboard. When these try to pause/play/skip songs, they will fail if the Spotify persistent notification controls are missing.