I believe the issue is just that when you connect to Puck.js from the EspruinoHub IDE on the Raspberry Pi, it is connecting to just the Bluetooth Serial port. It's not connecting as a Keyboard device, so when you go to send keypresses the command fails.
If you don't connect from the EspruinoHub IDE and instead connect via the Raspberry Pi's Bluetooth GUI, it'll might start treating it as a keyboard and it'd work fine.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I believe the issue is just that when you connect to Puck.js from the EspruinoHub IDE on the Raspberry Pi, it is connecting to just the Bluetooth Serial port. It's not connecting as a Keyboard device, so when you go to send keypresses the command fails.
If you don't connect from the EspruinoHub IDE and instead connect via the Raspberry Pi's Bluetooth GUI, it'll might start treating it as a keyboard and it'd work fine.
However looking at this post from a year ago, it's possible the Raspberry Pi doesn't support Bluetooth HID devices at all: https://www.raspberrypi.org/forums/viewtopic.php?t=176808
Things may have changed in the last year though.