Apple Magic Mouse/Keyboard Disconnecting From Bluetooth
Both devices were constantly disconnecting from Bluetooth. The fix was this:
Go to Macintosh HD -> Library -> Preferences and delete the file: com.apple.Bluetooth.plist
In my case I had 6 different files with various extensions like com.apple.Bluetooth.plist.Wiyihf4 etc.
Delete all of them. Restart Mac.
Problem solved.