I have created several automations and they look similar to the below one.

I was having issues with these automations since they were creating duplicate subtasks. To avoid that, I added jira.permission.edit.denied to the workflow statuses. I have it set up so that the subtasks are created when the user clicks on transitioning the ticket to the next status and a form pops up where the user updates the ticket and transitions the ticket to the next status where the ticket is locked.

The issue I am having is that when the ticket is moved from Functional Owner to Done, it is still creating subtasks even though the ticket is in Done stage and the property is set to jira.permission.edit.denied.
Is there a way to fix this?