I have an old Belkin USB 2.0 switch from god-knows when that works beautifully. I use it to share a hub with a keyboard and mouse attached. I’ve given up trying to find a 4K60 x2 DisplayPort KVM that doesn’t suck.
Wendell at Level1Techs does good work and there's even newer ones that can do 8k30.
[0] https://store.level1techs.com/products/kvm-switch-dual-monit...
https://www.startech.com/Server-Management/KVM-Switches/2-po...