The Keyboard library can only be used with Arduino boards that have native USB capabilities. Your Uno does not have native USB capability, so you can't use it with the Keyboard library. This is the cause of the (admittedly confusing) error message.
The classic Arduino Nano does not have native USB capabilities and so can not be used with the Keyboard library. The modern Nano 33 IoT does have it because it uses a different microcontroller (ATSAMD21G18 vs. ATmega328P).
The microcontrollers on the Nano 33 BLE, Nano 33 BLE Sense, and Nano RP2040 Connect do have native USB capability, but they aren't currently supported by the Keyboard library. So you can do keyboard emulation with these boards, but you'll need to use a different library. So I only recommend those boards in this particular application for advanced users.