I had this same problem and seem to have resolved it. This is my anecdote, which someone might find helpful.
TL;DR In my case it seems to have been caused by a gaming framework, either Steam or NVidia GeForce Now. Removing those caused the problem to go away.
I have a 2017 iMac running Mojave 10.14.4. The initial problem was that sometimes the bluetooth keyboard and mouse would disconnect all of the sudden. They always disconnected together. Sometimes they'd reconnect right away. Sometimes I'd have to fiddle around--turn the bluetooth off/on, turn the devices off/on, or occasionally reboot the computer.
I also noticed that when this happened and I tried to turn the bluetooth off/on through the menu bar, the bluetooth icon would sometimes hang in a reverse-video state. My impression was that the computer's motherboard might be having trouble communicating with the bluetooth module.
The computer is still under warranty, so I took it to the Apple Store. They ran a diagnostic and couldn't find a problem. But based on my description, the genius took the computer in to replace the bluetooth module. I got it back a few days later, and the problem kept occurring.
Back to the Apple Store a week later. A different genius suggested wiping and reinstalling the OS, saying that's what they should have done the first time before replacing any hardware. So we did that. After reinstalling the OS, he told me to take it home and reinstall all of my files from my Time Machine backup. I took the computer home, reinstalled from Time Machine, and used it over the next week. The problem was still present.
Back to the Apple Store again. The third genius wanted to wipe and reinstall the OS, and then not restore from time machine. This would rule out the chance that the time machine restore was installing something which was causing the problem.
I was getting annoyed by this time, as I was pretty sure the computer had a hardware problem. We discussed replacing the motherboard, but he didn't want to do that without a lot more troubleshooting.
In the end, we wiped and reinstalled the OS again. After getting the computer home, I just reinstalled a couple of apps that I couldn't do without, then used the computer for a week. The bluetooth worked perfectly the entire time. After that, I wiped and reinstalled the OS again and restored from Time Machine. The problem came back.
So, the bluetooth problem was due to something I had installed, which was being reinstated by restoring from Time Machine. I realized I had four different gaming frameworks installed, and they might plausibly be getting too intimate with the bluetooth hardware.
- I uninstalled the Good Old Games launcher, rebooted, and used the computer for a day. The problem still occurred.
- I uninstalled the Epic Games Launcher, rebooted, and used the computer for a day. The problem still occurred.
- I uninstalled Steam and NVidia Geforce Now, rebooted, and the problem hasn't reoccurred in several days.