Behavior tree gets stuck on task

Hi. My bot AI sometimes gets stuck on a specific task called attack. When it happens, the bot just stops moving completely and the behavior tree is visibly stuck on the task. It only seems to happen when he is behind cover so I’m thinking it might have to do with the line trace. It usually works fine for a while, but if the player character moves around a lot it seems increase the risk of the bot getting stuck.

If anyone could take a look and point out what I’m doing wrong I’d be grateful.

I tried putting in a service on the sequence on the right which checks if the bots velocity has been 0 for at least half a second, in which case it should go back to the sequence on the left, but it did not help.