Well… sort of, not really.
What happens when you “when” a role, it applies a “when” as the first condition of every task in the role.
So I suspect you have applied the “when” to your “set_fact”
All the “is_executed” stuff is generally non-idiomatic, the goal of a playbook is to allow repeated configuration, and should be written to allow reconfiguration or reassertion of configuration reliably.
If there are steps that will fail if rerun, failed_when can be a useful guide, as can conditionals around the stat module, but just guard those specific parts.