Having read a bunch of questions to this effect already, there seems to be a problem with identifying which window of the same app you want. The logic seems to be something like, "Look! Here's *a* window that comes from this process. That must be it!" When in fact it's a different one that might be farther down the internal list, or isn't even open yet. But because it's already grabbed one, it doesn't look again until that one goes away. Don't know if that's even solvable or not, which depends on how Windows itself works.
I still like the older method of capturing everything that goes to a particular device. That goes for both picture and sound. And then you control what goes to the device that you're capturing, so that you only get what you want. So for the picture, you have a designated screen that you capture, and control what's on that screen. And for the sound, you have a designated sound card that you Desktop or Output capture, and control what goes to that sound card. As far as the computer is concerned, you simply have multiple speakers, and you want different things to come from different ones.
The captured device could be physical or virtual. It doesn't matter which because they both appear in the same list and behave the same way as far as any app is concerned. In theory, physical has the advantage of not needing to install anything, and virtual has the advantage of not needing to buy anything. Practice tends to blur those lines a bit.
A popular virtual one for Windows seems to be:
VB-Audio Virtual Cable and App's
vb-audio.com
Or if you want to have some additional processing/routing, between the app to capture and OBS:
VoiceMeeter Banana, the Advanced Virtual Audio Mixer by V.Burel
vb-audio.com
VoiceMeeter Potato, the Ultimate Virtual Audio Mixer for Windows
vb-audio.com
Note: all of those are free to install and try, but they'll nag you until you buy a code. I'm sure there are other, completely free ones, but if you're already paying for Windows in one way or another...