TeamSpeak SDK disconnect device bug

If current audio device gets disconnected, teamspeak clientlib will give some errors

2024-04-01 11:48:08.520501|ERROR   |Windows Audio Session|   |[Playback] unknown error: AUDCLNT_E_DEVICE_INVALIDATED (0x88890004) - Headset (F9 Hands-Free AG Audio)
2024-04-01 11:48:08.647500|ERROR   |Windows Audio Session|   |[Capture] unknown error: AUDCLNT_E_DEVICE_INVALIDATED (0x88890004) - Headset (F9 Hands-Free AG Audio)
2024-04-01 11:58:37.346588|ERROR   |Windows Audio Session|   |[Capture] CaptureDeviceContext callbackWaits2 wait exceeded 5 secs 258 - Microphone (Realtek(R) Audio)
2024-04-01 11:58:37.346588|ERROR   |Windows Audio Session|   |[Playback] RenderDeviceContext callbackWaits2 wait exceeded 5 secs 258 - Headphones (2- F9 Stereo)
2024-04-01 11:58:37.346588|ERROR   |Windows Audio Session|   |[Playback] RenderDeviceContext callbackWaits2 wait exceeded 5 secs 258 - Speakers (Realtek(R) Audio)
2024-04-01 11:58:42.350971|ERROR   |Windows Audio Session|   |[Playback] RenderDeviceContext callbackWaits2 wait exceeded 5 secs 258 - Speakers (Realtek(R) Audio)
2024-04-01 11:58:42.350971|ERROR   |Windows Audio Session|   |[Playback] RenderDeviceContext callbackWaits2 wait exceeded 5 secs 258 - Headphones (2- F9 Stereo)

and eventually will hang on come function calls (e.g. ts3client_closeCaptureDevice)

It can be reproduced with bluetooth headphones and sdk demo client “ts_client.exe”

Is this a bug? Or there is a way to recover from this situation (can not simply open new device as it will hand as well)