Hi There,
Struggled with this issue for MONTHS. The solution was to turn off FileVault. I have two partitions on my machine, one that has a mouse and keyboard problem, which we will call the DIRTY version, and the other partition which does not have the mouse and keyboard problem which we will call the CLEAN version. I noticed that the dirty partition had FileVault ON, while the clean partition had FileVault OFF. As a test I turned FileVault ON on the clean partition and lo and behold, the mouse/keyboard issue suddenly appeared. To be clear, let me explain again. The clean computer had no problem with the mouse and keyboard, but when I turned file vault on, it suddenly had the mouse and keyboard issue.
Conversely, I went back to the DIRTY partition and turned FileVault OFF. IMMEDIATELY the mouse/keyboard issue went away. The mouse and keyboard now function normally on the previously DIRTY machine.
Now my mouse/keyboard work perfectly.
This issue only began when I installed Big Sur. Before Big Sur the machine worked perfectly. I spent MONTHS on the phone with Apple Care support which was useless. I even took it into the Apple Store and they couldn't figure it out and gave it back to me. Apple even sent a technician to my studio twice to replace the power supply and the RAM. All to no avail.