Magic Keyboard Doesn't Reconnect to Mac after Pairing to Windows PC
I've had a Magic Keyboard with Numeric Keypad for a couple years, and I have used it seamlessly between my iMac and Macbook. When powering on my iMac, the Magic Keyboard will automatically connect by Bluetooth even if it was previously used with my Macbook and vice versa. It remembers my Apple devices.
I recently used my Magic Keyboard with my Windows PC. It connected fine by Bluetooth and worked as expected. However, the following day when I powered on my iMac, the Magic Keyboard refused to connect by Bluetooth. I tried powering the Magic Keyboard on/off - no luck. I couldn't login to my account to try troubleshooting options (no way to type my password), so my only option was to physically connect the Magic Keyboard to my iMac via a USB-Lightning adapter. My USB ports are occupied by other devices, so it's a bit of a hassle to have to reconnect the Magic Keyboard this way.
Is there something I can do to make my Magic Keyboard automatically reconnect to my iMac after it has been used with a Windows PC, or is my experience the expected behavior of the Magic Keyboard?
Mac mini, macOS 13.5