This is not the fault of the device, or even Windows for that matter necessarily.
The issue lies with the programs themselves and how they interact with the default system audio device in Windows.
Some programs will remember the device so when the default system device gets switched (especially automagically) the program will continue trying to output audio to the previous device. This happens randomly sometimes for me when swapping from headphones to my bluetooth speaker or whatever in Firefox while playing a YouTube video.
The only thing you can do is:
1. Just always have bluetooth set up before you go opening 20 programs
2. Try manually changing audio devices back to previous the back to bluetooth rather than just letting them auto connect and the system auto switch and just leaving it at that.
3. Using something like Voice Meeter and having that started up from system start with audio routing already set, so that you can swap output devices in Voice Meeter but Voice Meeter itself stays the default system device the whole time so programs don't ever get confused. This can come with it's own headaches though as it's not a perfect piece of software and has some quirks and can mess with some programs that need to capture system audio for things forcing you to HAVE to use Voice Meeter no matter what as your audio system while it's running because of the way it hijacks things to work the way it does.
4. Just continue to unfortunately deal with the nonsense if something like option 2 doesn't work, and just restart said programs, (or manually swap output audio device if said program supports manually choosing what device to output it's audio to)