Need hel with room lighting ,Im sure im just missing somethins

This room lighting rule has been misbehaving for a while. It is a motion/contact-based rule. 90% of the time it works, but sometimes it will still shut off even if there is motion. and not turn back on for several minutes once it does. I'm sure I'm just missing something, but I'm just not sure what it is. Hoping a fresh set of eyes can see what I'm missing. Thanks!

Rule




Here are the settings for the motion sensor in the rule.

Settings for the motion sensor



Logs should have the clues - when one of these whiffs happen, I'd review logs for both this automation and the motion sensor to determine which one is behind the issue (as I doubt it's related to the contact sensor, but may be worth reviewing its logs too).