Maybe the problem is in buggy dungeon layout. The pet thinks that your somewhere else, in another room.

You might have notice that too, getting in certain room corner and your pet who was following you all of the sudden start running in the opposite direction. Just like the pet thinks that you leaved that room and are into another.

I've done a test with my pet, you know that large room with a big rectangular table.... Have your pet follow you, go in walk mode to be sure he's in your back all the time. Then slowly back up in a corner. As soon as you hit that corner, the pet all the sudden start running the opposite way, immediatly get out of the corner and the pet come back to you. It's not all rooms, but some make your pet go nuts when you hit a buggy corner.

Same thing happen with certain monster, sometime a monster is in the far corner of a room and you can't attack him or select him. I strongly believe that some rooms are bugged. You think that a monster is in front of you, but for the game it's somewhere else, in a another room.

Pet pathing might be more related to bad dungeon layout. Try to follow someone when all of the sudden that person who was 2 feet in front of you warp into another room, then 2 sec later he's back at is previous position.