Pending Kill Error AI

Hi everyone, I’ve been messing around with AI lately and was trying to make an AI that could switch between melee and ranged modes.
Well, once I have everything set up, it breaks saying the following error.


I have to say that I have a parent enemy of which all the others are children and take several of their characteristics, such as hitting or picking up a weapon and shooting.
in the end, everything is activated with a task that gives the command. But this works in a weird way, because, yes, it performs the action of picking up a weapon and shooting but the character is completely frozen.








I hope it is understood as well as possible and that someone can help me with this.