Ah, thanks mate! I found that solution here too, Variable scope in automation - not clear what's wrong - #5 by WallyR, but didn’t understand how to apply this properly <3
Update: I had to add this to set the results
to false
if the loop did not return true
{% set ns = namespace(results=false) -%}
{% set ns.result = false -%}