I would pay a lot for an Apple Magic Keyboard with something like an H1 chip from the AirPods to speed up switching between devices. Extra if it comes in black.
The only reliable way I found to move the keyboard between iPad and Mac is:
- Connect it to the one is was last paired with
- Unpair from Settings/Sys Prefs
- Pair with the new device from Settings/Sys Prefs