The magic words you're looking for are "EDID emulation". The KVM will continue to send the EDID data from the monitor even after you've switched away, which will fix that issue.
It's relatively uncommon and not always implemented super well, but it's a requirement for any DP KVM to be not super annoying IMO.
There was one particular KVM brand that was supposed to do it well whose name is escaping me now :/. I was looking at buying one in ~ May 2020 for obvious reasons, but they were on super-backorder (also for obvious reasons), so I never got around to it. IIRC they were about $500 for a 4 input/2 output version, so not cheap.
It's relatively uncommon and not always implemented super well, but it's a requirement for any DP KVM to be not super annoying IMO.
There was one particular KVM brand that was supposed to do it well whose name is escaping me now :/. I was looking at buying one in ~ May 2020 for obvious reasons, but they were on super-backorder (also for obvious reasons), so I never got around to it. IIRC they were about $500 for a 4 input/2 output version, so not cheap.