I'm trying to update parent(epic link / parent link), when I delete an issue. below is my automation rule.

But I got error when I try to delete a story "AAAA-19" and it has an epic link "AAAA-16".
below is the audit log. (10451 is my project)

Seems automation is trying to exclude current issue when I use JQL to find parent, but the child issue has been deleted, so JQL can't find it, and then throw exception.
how to resolve this?