How to disable PIR with Tasmota rule while MQTT unavailable

Actually you don’t have to disable PIR while MQTT broker not available - PIR can be still on and work as expected with rule posted above - you can simplify that rule if you don’t want to report motion.

Something like that will turn off your light 5 minutes after last motion and MQTT broker connectivity will have no effect on relay:

on switch2#state=1 do backlog power1 on; ruletimer1 300 endon on switch2#state=0 do delay endon on rules#timer=1 do power1 off endon