Sadly I don't think you can invoke this behavior and this is not the solution you are asking for, though as I imagine you are using a keyboard (apple?) you could always use the hotkeys to lock your laptop and screen.
Option–Command–Power / Option–Command–Media Eject: Put Mac to
Control–Shift–Power / Control–Shift–Media Eject : Put
display(s) to sleep
I had this same issue and Elgato was unable to solve it so I just began plugging my monitor directly into my Macbook's (Retina mid-2014) HDMI port.
After updating to Catalina I thought I'd try it again but now my monitor (Samsung 27" full HD) wouldn't sync to my Mac though the Elgato HDMI port, however it would sync through a displayport-to-HDMI adapter ...
The problem is the macOS continues to check for updates (including email, software, news, etc.) while your MacBook Pro is asleep (this feature is called "Power Nap"). This means it's very quick to get up and running when you open your MacBook, but it also means your battery goes down while it's asleep.
The problem some people have is that even with "Power ...