We have got a similar issue: When the smartphone is locked, not used in a certain period of time and the playback queue in spotify finishes then the connection between the Spotify platform and the device is lost.
The device somehow goes offline immediately after finishing the last song in the queue and is not accessible anymore via Spotify Web Api until you restart the Spotify App on the smartphone.
For us, on iOS devices in particular, if you pause playback for less than 6 seconds, then resume, the playback resumes correctly when Spotify app is minimized. But if you pause for longer, playback does not resume until Spotify app is foregrounded again. The Spotify web player at https://open.spotify.com does not have this limitation, and you can pause for any length of time, and resume, and playback will correctly resume from the still backgrounded Spotify app on the iOS device. So it is possible, but it is not documented how.