Experienced the exact same symptoms, but it was with my car audio system's Bluetooth instead.
I went to toggle around with the settings allowing apps to run in background after I noticed that some widgets stopped working after I disabled them from running in background. Realised that Spotify was disabled as well, and after enabling it, I seemed to have fixed the problem! So hopefully this will solve your issue as well :) steps listed below.
Settings > Device Care > Battery > Settings (top right corner) > Sleeping Apps. From there, just remove Spotify and any other widgets which seem to be malfunctioning.
found out it was because I had set my spotify app to go to sleep when "not in use". This is why it worked only for a few seconds after I manually pressed play/pause. Go into your phone's settings. Go to Device care and tap on the battery settings. From there find the Spotify app among all your other apps and once you tap on it you will get some information about battery usage. The very last item should say "Put app to sleep". You want to make sure this is off. Hope this helps, it worked for me.