When you track, the algorithm marks the rooms it has gone to with a roomflag (BFS_MARK). This should apear in "stat room" as a "*" in the roomflags. Check that in the rooms between the one you're in and the expected target.
Another thing that might be your problem is that you're tracking something with a common name. When running track, these things happen:
- your input is parsed
- the argument is used to look up the target in the world. This is akin to "where guard". "track guard" would lead you to the topmost guard on that list.
- the room graph is searched for the specific mob we determined in the previous step.
To check if this is happening, try giving your test mob a strange alias ("dfghjk") and try tracking THAT (track dfghjk) and see if you're still being led astray.