The Cinnamon screensaver offers the DBus service
org.cinnamon.ScreenSaver, which, among others, has the following method:
method void org.cinnamon.ScreenSaver.Lock(QString body)
This method is exactly the one being called when locking the screen with a custom message. If you want to call this from a bash script, you need a DBus frontend, such as gdbus or qdbus.
I personally prefer qdbus, as I haven't understood gdbus' syntax yet. You may, however, have to install qdbus first with
sudo apt-get install qdbus
This may install some other Qt libraries, as well. When installed, you can call the method using
qdbus org.cinnamon.ScreenSaver / Lock "$message"
$message containing your custom message. This method call, however, will not work if the screen is already locked. If this is the case, the method will block until the screen is unlocked and then returns without re-locking the screen.