Lights on with open/close sensor and off with motion stops

I had this setup in my basement utility room to thwart the cat turning on the lights when solely using motion sensor for lights on / off.

I wanted the lights to turn on when I opened 1 of 2 doors and then off after 5 min of motion stops.

This once worked quite well, but now, when motion stops, it appears the light off command is followed up with a lights on command…followed by another off command 5 min. later.

Initially I thought this was poltergeists but now am thinking this particular issue is not related.

Ticket placed and I saw similar results when searching but nothing specific.

It looks as if this unexplained behavior is somehow due to trying to setup motion off through smart lights. If setting up at device level there appears to be no issue.