You can use a repeater to physically implement it, but it should be possible with better display.
Create a Virtual Screen
Click the BetterDisplay menu bar icon → Settings → Dummy Displays → Create New Dummy
Match this dummy to your monitor’s native aspect ratio (e.g., 16:9)
Configure Mirroring
Open your Mac’s System Settings → Displays. Set your actual physical KVM-connected monitor to mirror the new virtual dummy display. Then, just make sure the dummy is set as the “Main Display.”
Sleep setting
In the BetterDisplay settings under your Dummy display options, locate the setting for “Disconnect Behavior.” This should be set to “Ignore display disconnection.”
Let me know if this works for you.