Eastern SD | I do what you're describing to share Keyboard, Mouse, and Webcam between 2 pc's. Works pretty well. Below is one I've been using. I then switch the desktop monitors using their input selection menu's instead of a KVM. This particular switch automatically switches inputs to the most recently connected PC, until you switch it back. So when docking the laptop it auto switches back. That is mostly a feature but could be an annoyance depending on how your workflow goes.
https://www.amazon.com/Selector-ABLEWE-Switcher-Peripheral-One-Button/dp/B07TS5JNT3/ref=sr_1_3?dchild=1&keywords=usb+switch&qid=1597690614&sr=8-3 |