Go to Settings → Bluetooth & devices
Turn Bluetooth OFF, wait 10–15 seconds, then turn it back ON
Try removing the keyboard again
Press Windows + X → Device Manager
Expand:
Bluetooth
Keyboards
Find your keyboard (may appear twice)
Right-click → Uninstall device
Then restart your PC