Please follow the Community Question Guidelines by posting your automation’s YAML configuration… it makes it a lot easier for us to see any possible issues that may be hard to spot in a screenshot of the UI Automation Editor.
Based on a cursory glance of the provided screenshot, it looks like you have misunderstood how conditions work.
That’s because your automation starts with an action to turn the light on and ends with an action to turn the light off. When it doesn’t turn off at all it’s because the branched logic leads to the Stop action.