The problem isn't with the monitor it's the design of the USB port operation. Whenever the system goes to sleep or locks it appears to stop monitoring the ports for changes and providing power to the devices. I have an Elgato Stream Deck + and Stream Deck XL connected to my Studio and they both shut down whenever the screen locks, system sleeps, or screen saver starts and they become completely non-responsive.
My guess is that your mouse and keyboard are also attached to the dock, if so, they also don't respond for this reason. This doesn't appear to be the case for bluetooth devices as they always respond when activated. Unfortunately, you can't pair an apple mouse or keyboard to more than one system at a time. You could do two mouses (mice?), one paired to each computer and just swap the mouse you use when changing system. This doesn't help if you are like me and using a wired non-apple mouse (please forgive me for the blasphemy) because of the added functionality that it may have or you do gaming. The magic mouse that's the size of a 2/3s used bar of soap just doesn't cut it for me.
I know this doesn't solve you problem directly, but you'll just have to accept it as the apple way, so it must be working right.