Have you got another device around that your keybd etc. has
ever been connected to?
I had a keyboard that was paired to a machine upstairs. Long ago I had also paired it to one downstairs. Sometimes the device would still try to pair downstairs, on good
heaviside layer days?, and this would cause glitches upstairs as you describe. One day the connection was good enough that it succeeded in pairing to the distant downstairs Mac. That killed functionality upstairs completely, but brought up a helpful dialog downstairs alerting me to what the trouble was. I unpaired from downstairs and told it to forget the device, also turned off bluetooth down there as I don't need it.
The keyboard is now much more reliably connected.