Walls and really any kind of obstruction have long been death to the AI. Some years ago it was absurdly bad for months, they eventually improved it, but it’s still been a constant problem. Only solution (which is often very hard to accomplish) is to keep thralls in the open for combat.
It would be a huge boon to get this actually fixed because it is still a constant issue - thralls not fighting completely out in the open will often just stand stupidly and get hit.
Thrall AI is atrociously bad. You really have to micro-manage each step they take and tell them to attack the appropriate enemy, otherwise like you said they stay aggroed on an enemy far away and ignore the pile of enemies right in front of them ripping their dumb face off.