Apple - Lock Mac without turning off the screen
KeepingYouAwake is a free and open source app that can be used for this purpose.
The intended purpose of this app is to prevent your Mac from going into sleep. You can activate this app from 5/15/30 minutes to 1/2/5 hours to indefinite duration.
Having KeepingYouAwake activated will prevent screen from turning off when lock screen mode is activated.
KeepingYouAwake can be easily installed using Homebrew by running the following command:
brew cask install keepingyouawake
I had the same problem, I used the free app Amphetamine from the app store. After installing, I selected the indefinitely option to keep the screen for awake forever. I locked the screen and the screen is still on.