Will a switch of the kvm disconnect the monitor from the pc

This sounds like you’re wanting monitor emulation. What operating systems do you have your work and game PC? In Windows 11 this fix is as simple as toggling on the setting in “Display”