I guess this one is a rare corner case, but it’s still a bug:
My Windows is configured to play audio through a different device once I plug in head phones, so that speakers are muted. Speaker audio goes through the graphics card via HDMI/display port to the screen’s built-in speakers, headphones are attached to the motherboard’s sound outlet - so the actual active sound adapter changes (but the old one is still valid with a lower priority). Normally, this is transparent to DirectX applications and audio just switches over.
Without knowing the device enumeration code in your game, I can’t tell what exactly is going on, but the game still plays audio through the wrong device unless I restart it.