3. Asynchrony and Brutal Race Conditions
Initializing a wireless audio device at the OS level is a lazy and slow process. The headphones need to wake up, exchange encryption keys, and then the system must load the driver, initialize the codec, and create an endpoint in the audio mixer. This takes several seconds.
If your code tries to run a sequential chain of commands like "Connect Device -> Set as Default -> Play Audio", it will guaranteed crash midway. As far as the audio system is concerned, the device does not even exist yet. You have to build complex state machines and hunt for the exact microsecond when the OS finally finishes initialization.