Why does Pathfinding Service make NPC's Run into walls and then go back to the beginning?

Why does Pathfinding Service make NPC’s Run into walls and then go back to the beginning? This is highly making the NPC in my game irrelevant as I do not not know how to fix this.