How to reset Mac's Bluetooth module
After booting to an earlier macOS (AFAIR it was Catalina) and then back to Sequoia Mac mini 2018 Bluetooth Magic mouse and keyboard stopped working.
The usual trick to just power the mouse OFF/ON did not help. Also a forced shutdown followed by reboot did not help. So I had to connect the keyboard via USB and grab a wired mouse for further troubleshooting.
Turning Bluetooth OFF/ON or forgetting those devices did not help. Bluetooth settings offered to Connect the mouse but that repeatedly failed.
All the time Bluetooth occasionally by itself turned OFF/ON in the Bluetooth settings and in System Report > System Information Bluetooth state reported to be OFF while in the menu it was ON (maybe the System Information did not update its info in real time).
Resetting SMC and PRAM, and safe boot did not help.
I tried to reset the Bluetooth module via the Terminal with 'sudo pkill bluetoothd' but that did not help.
Big Sur and earlier has yet another way to reset the Bluetooth module so I booted to an external volume's Mojave which I luckily had readily available. Lo and behold, in Mojave Bluetooth worked right away. But while being there I did all Bluetooth debug options via Shift-Option clicking the Bluetooth menu icon (i.e. Reset the Bluetooth module, Factory reset all connected Apple devices, Remove all devices) and the devices readily re-connected.
Then booted back to Sequoia where Bluetooth also worked OK <relieved sigh>.