I found that using an audio-only transmitter worked far better for me than a direct connection when trying to get Bluetooth audio from a PC.
There are just too many issues like the one you ran into, or things like playback breaking if the signal disconnects briefly - since Windows removes the playback device.
By decoupling it from the PC, and only treating it as an audio source, you avoid all of these problems; but you do lose control via the device.
I use an Avantree Oasis Plus with my PC, since it can transmit and pass-through audio simultaneously.
This allows me to transmit audio to two Bluetooth devices, while also sending audio to my DAC (via toslink).
That way I don't have to touch the transmitter at all, I only switch on the device I want to listen to.
The Oasis Plus is expensive though, at $70
https://www.amazon.com/dp/B07BQYYDNJ/They have other products which are less expensive though, if you don't need the simultaneous transmit & passthrough functionality:
$30 USB Bluetooth 4.1 transmitter:
https://www.amazon.com/dp/B07Q3CBZZJ/$40 USB Bluetooth 5.0 transmitter with antenna:
https://www.amazon.com/dp/B07W5DDZQN/$50 Optical/Analog Bluetooth 5.0 dual-device transmitter:
https://www.amazon.com/dp/B07WW3ZHTQ/ I have no affiliation with Avantree, I just have a few of their products after trying many of the others for sale on Amazon.
The Avantree transmitters/receivers are the only ones which worked consistently well for me.
One thing I will caution you about though: this type of transmitter is aggressive with its connection.
As soon as they are switched on, it's all my headphones will connect to. I have it hooked up to a smart plug so that I can switch it on/off via Alexa voice commands.
It may partly be due to my Bose headphones supporting multiple connections though. If I switch connection on the headphones, it always pairs to Avantree+Phone, or Avantree+Tablet etc, and the Avantree transmitter takes priority. It doesn't want to switch to Phone+Tablet if the Avantree transmitter is on.
But that happens with all of these devices, not just the Avantree one. I tested five others over the holidays, as I only needed a short-range aptX-LL receiver and wanted to save some money, but ended up keeping the $50 Avantree TC419 because it's the only one which did the job correctly. All of them had that problem in TX mode.