Find Path to Location Synchronously makes strange paths every now and then, how can I fix it?

i think the first point in PathPoints is the Origin so when you snap that to grid you move the origin causing it to take a weird path.

another thing to check is that its not trying to avoid itself due to some unexpected collsion