Here are the scenarios I've reproduced the exact same symptoms with:
Keyboard/Mouse -> Surface Dock 2 -> Surface
Keyboard/Mouse -> Generic USB-C Hub -> Surface
This *only* happens with keyboards and mice. Example: My webcam plugged into the same hub/dock works 100% of the time.
I can reproduce this issue with three keyboards. The problem isn't the keyboard. The problem isn't one particular hub or dock.
When the keyboard/mouse is plugged into the surface directly, I have no issues - unfortunately, there are a *very limited* number of USB ports, so this isn't a viable solution.
I can only solve this issue by editing the power plan. Pwrcfg is super complex, so I haven't been able to spend *more* time figuring out exactly whats happening here. I only know when I make the change (somewhere in this thread), I can get the keyboard working for long periods of time.
The issue isn't outdated firmware. I will scream if someone tries to tell me to reinstall windows, or to "check my firmware". All of these devices are up to date (including my Surface device, which is a Surface Laptop Studio).
This thread clearly shows something systemic (likely with the pwrcfg plans for processors related to power saving, specific for surface devices). I encapsulated the pwrcfg command in a powershell script run each time the system starts.