I use a Logitech k400r (keyboard with built in trackpad) and whilst I've never had a problem with it on any of my old Pis, form the Pi B+ or whatever it was, through the Pi 2s and 3s, the Pi 4 has given me nothing but trouble. I thought it was batteries, but changed them from NiMh to recharged NiMh, with no luck. Swapped them for Alkaline, then Lithiums - and no luck.
Changed the position of the donger from USB 2 to USB 3 and back. with no real difference. But noticed some difference when the keyboard was positioned at various angles. So I tried plugging the dongle into a short USB cable, then into USB 2 and USB 3 ports.
It turned out that the wireless keyboard is more sensitive to distance, and much, much more sensitive to the relative angle of the keyboard and the dongle, than it ever was with the other Pis.
Yesterday I decided to do some work that required me to place the keyboard on a card table, rather than on my lap. I had to go through a heap of positioning and taping of the dongle and the cable to get it and the keyboard in correct relative positions to talk with each other. Even though the keyboard is about a metre closer when it is on the table! I suspect the aluminium frame of the table, while not even close to line of sight, was interfering with the wireless signal.
If I turn on my BRIX Celeron computer, at the other end of the TV from the Pi, and swap the dongle to it, there are no problems. And if I swap the dongle to the Pi 3B+, whether the Brix is On or Off, there is no problem. I only have the issue with the Pi 4.
But !!! It was relatively simple to overcome, with a short cable for the dongle - and some adhesive tape to hold the dongle in position, once I found the best spot