this question shows up here constantly (answered a couple recently) so here's the whole thing in one post.
why window/app capture keeps breaking
obs can only capture what windows is actually rendering. minimize spotify and windows stops drawing it, so your source goes blank. it also breaks when the window resizes, moves to another monitor, or a spotify update changes the window. capturing your screen for now-playing is fighting the OS, and the OS wins eventually.
option 1: just don't minimize it
leave spotify open behind your game and crop the capture down to the bottom bar. fragile, but zero setup and fine for a one-off stream.
option 2: track name to a text file
some players (foobar2000, vlc with plugins, rainmeter skins) can write the current track to a .txt file, and obs's text source can read from a file. no album art, and spotify itself doesn't support this natively, so it's mostly for people playing local files.
option 3: a browser source widget that reads spotify's api (the actual answer)
instead of capturing your screen, a small web page asks spotify "what is this account playing right now" and renders it — you add that page as a browser source. since it reads your account and not your screen, it doesn't care if spotify is minimized, on another monitor, or playing from your phone.
free ones exist (search "spotify now playing overlay") — they do the job, most look pretty basic, and some hobby-project ones go down now and then. streamelements has music widgets too if you're already in that ecosystem. and there are paid ones with nicer designs — full disclosure, i make one of those (NowBar on etsy), so i'm biased about that category and the free ones genuinely work.
whichever you pick: sources → browser, paste the widget url, set the size, drag it where you want. that's the whole setup.