I have discovered, at least in my case (MacBook Pro (15-inch, 2016)) disabling FileVault solves the issue that prevented magic mouse and magic keyboard from connect each reboot.
This makes sense to me since when you have FileVault enabled the Mac shows a login screen that is not actually inside the operating system. I guess the login screen you get when FileVault is enabled is to decrypt the disk each reboot before loading the OS. Disabling FileVault takes you directly to the OS login screen which is able to connect to your bluetooth devices since the PS is fully loaded.
Be aware that disabling FileVault takes time specially if you have a lot of disk space used, the larger the disk, the longer the time it will take to disable it.
Hope this info is useful to you.