Because you are “grabbing” the action to a global reference outside of your rule, it needs to be available at the moment the rules file is parsed. If it isn’t, there is no recovery.
We know openHAB files load sequence is umm a bit iffy.
I would restructure to improve your chances.
rule "Garage door lock status updates"
...
then
val mailActions = getActions("mail","mail:smtp:989680e0")
...