NPCWandermode 6, also known as the "pathfinding" wandermode (see line 1548 in movement.cpp), seems to be bugged.
I've tried using the JS event (which seem to work, couldn't see anything obviously wrong with it at least) walkTo( object, maxsteps) and walkTo( x, y, maxsteps ). If the destination location lies directly to the north, south, east, west, northwest, northeast, southwest or southeast of the NPC doing the walking - the NPC will turn towards it correctly and start walking. It will not, however, stop until it has taken all the steps specified in "maxsteps", or until it walks into another object/wall/whatever, even if it should pass it's destination location on the way.
If the destination isn't a direct "compass-direction", the NPC will turn in the general direction of the target location, and will then keep walking in that direction and not make any "pathfinding" corrections to it's heading. As with the above, it keeps walking until it bumps into another object or until "maxsteps" has been reached.