The most common version of this problem isn't sleep at all: you lock the Mac for a coffee and come back to every window on one screen. It happens because macOS turns the displays off a few minutes after you lock, and a DisplayPort monitor that sleeps looks unplugged to the Mac. The write-up has two Terminal commands to confirm it on your Mac, plus the settings that stop it and what they don't cover. https://manydisplays.com/mac-los... If it happens on your desk too, I'd like to hear which monitors you use.