NavMesh.CalculatePath creates a path that jumps around when moving an obstacle

I am working on a tower defense deck building game, there is a path that leads the enemies from their point of origin to their target, I have a line renderer that shows it on the NavMeshSurface, when the player adds a tower, he can “interfere” with the path (I allow it in code as long as a new path can be found), the tower is an obstacle and it carves the navMesh in real time, when the tower is in the way of the existing path it causes the path to change. everything works as expected.
the only problem is that sometimes weird things happen, I attached a video that shows that a specific (very specific) tower positioning by the player, causes the path to change radically, and it doesnt seem to be the most efficient path any more.
any idea on what causes it? or how to debug it?

the code I using to find the path:

private void Start()
{
      path = new NavMeshPath();
      navMeshQueryFilter = new NavMeshQueryFilter
      {
             areaMask = navMeshSurface.layerMask,
             agentTypeID = navMeshSurface.agentTypeID
        };
}
private void Update()
{
      NavMesh.CalculatePath(startPoint.position, endPoint.position, navMeshQueryFilter, path);
      if (path.status == NavMeshPathStatus.PathComplete) DrawPath();
      else Debug.Log("Path not found");
}

9817197--1410774--Movie_007.gif
[/code]