Hi,
Access the device manager in the Bluetooth tab with the device turned on and see if the keyboard's name appears. If so, go to the Start menu > Settings > Bluetooth & Devices > View more devices > look for the Bluetooth Keyboard > remove the device.
Restart your PC and try pairing again.
Check if the keyboard you are using has a USB dongle for direct use in addition to Bluetooth.
Thanks