Yeah currently the Pathfinding seems to be unable to actually to manage closed spaces.
When your Marshing an Army near an Wall the Pathfinding assigns spots for each Unit of which some are inside the Walls.
The Unit itself seems to be doing the Movement Check and then notices it cant move into the Walls which makes this Unit stand Idle instead ^^
Tough thats only my unqualified hunch on it
I hope they give some priority to the Pathfinding Update soon.
Its one of the biggest Issues in DoF by now.