Automation to continue after device unavailable

Is there a way to keep an automation running even if one step of the Actions fails? Some kind of try-catch block or something?

I have an automation to turn off all my devices and set a variable so that my motion sensors won’t work anymore whenever both me and my girlfriend left the house. Now sometimes my lamps become unavailable because my girlfriend manually turns the switch or something. When a lamp is powered off the scene activation to turn off all the lamps in the house will fail because the devices are unavailable. Then the automation will stop all together and the variable will not be set. Currently I just changed the order but I don’t think that is a very nice solution.

continue_on_error : true