I had the same issue with my Airpods Pro and my Lenovo A485 running Windows 10 Pro. My Bluetooth adapter supports Bluetooth 5.0/LMP 9. The issue seems to be a power saver mode. Changing back and forth the playback device seems to enable the device for a couple of seconds and then something switches it into standby.
To solve the issue, you may follow the instructions from this reddit thread https://www.reddit.com/r/airpods/comments/5r2k63/airpods_shutting_offdisconnecting_with_windows_10/
For keeping AirPods connected indefinitely to a Windows 10 device:
- Go to Device Manager
- In the 'devices by type' view, open the "Human Interface Devices**"** (not "Bluetooth")
- Find either/all of these entries:
- (Name) AirPods Audio/Video Remote Control HID
- (Name) AirPods Hands-Free Call Control HID
- "Bluetooth Low Energy GATT compliant HID device"
- For each of the devices, right click and choose Properties
- Go to Power Management tab
- Uncheck the 'Allow the computer to turn off this device to save power' box.
- Click OK
Worked for me nicely.