I've had this issue for a good while now and have noticed others experiencing the same problem but I think I might have some more specifics on the matter.

I use a Samsung Galaxy S8+
I run foobar2000 Mobile 1.2.0 beta 9

Foobar plays normally and would continue to play normally until I pause playback for a while, say 10 to 30 minutes, and resume. It would resume playback normally, however after the device screen is turned off, playback would stop abrupt after 10 seconds or so. As soon as you turn on the device again, it would continue playing. At this state, the device has to be in a "screen on" state, locked or unlocked, for playback to proceed. Once the screen goes off or goes to standby, playback will halt after a while.
In the short testing I've done, it seems that the issue is invoked by using the pause button on my bluetooth headset. Using the pause button through the lock screen doesn't seem to reproduce the same problem. However, the issue is still prevalent even after disconnecting from my bluetooth headset until I restart foobar.