I'm CONVINCED this was a driver issue all along - *at least for me.*My situation:
I have the Microsoft Surface Keyboard and Mouse. Paired with my Surface 4 Pro, I never, not once had an issue. For about 6 months, nothing.
I moved on from the Surface to a Dell XPS 13 2-in-1, and every now and then, the keyboard would disconnect. Not the mouse, not my headset, just the keyboard.
This drove me to formatting the laptop and starting fresh, which I was thinking of doing anyways as I'm not a fan of out of the factory setups.
It got worse!
I tried everything on this site and other sites, over and over... Eventually, and as Lynton Brown mentions in their post on August 4, 2020 - I noticed that if I just press the windows key and wait - it comes online. I got into the habit of pressing Caps Lock on the laptop keyboard so I knew when the Surface keyboard connected, as its light would also come on.
If I wasn't so busy at the moment, I was considering another format.
BUT THEN...
Windows updates came and went and shortly thereafter one of the many 'tools' I've installed during this venture popped up. "Laptop Firmware and Bluetooth Driver updates are available". I jumped on this, and it's worked!!! I don't know why it took a few months to get the driver - beta testing maybe?!
I'm hoping there's no eggs left to hatch, and my chicken count is good - but since this update, my keyboard hasn't disconnected once.
I've included hyperlinks to my products for clarity, and below are the drivers that updated. Hopefully this helps you in your quest for a constantly connected keyboard. It really shouldn't be this hard.
From Intel.com: