It's easy to reveal in dungeons. If my hero starts to use 'stun' ability, he tries to stun all units near him. When one unit blocks hero's way, he still tries to stun unit that is unreachable and doesn't attack a unit that is in from of him. From my point of view, if unit is unreachable (I don't know whether units standing in front of yours affect path found to reach another unit), do not try to reach him.
You're quite right, there seems to a problem with the pathfinder that is either specific to dungeons, or is more noticeable there. I'm looking further into it.
It's easy to reveal in dungeons. If my hero starts to use 'stun' ability, he tries to stun all units near him. When one unit blocks hero's way, he still tries to stun unit that is unreachable and doesn't attack a unit that is in from of him. From my point of view, if unit is unreachable (I don't know whether units standing in front of yours affect path found to reach another unit), do not try to reach him.