If your Bluetooth works great on almost everything except keyboards and mice, then your controller mode configuration may be the issue.
Edit
/etc/bluetooth/main.conf and find ControllerMode:
sudo nano /etc/bluetooth/main.conf
# Restricts all controllers to the specified transport. Default value
# is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW).
# Possible values: "dual", "bredr", "le"
ControllerMode = dual
Restart the Bluetooth daemon to apply the change:
sudo systemctl restart bluetooth
Your Bluetooth mice and keyboards will now connect reliably.