### Godot version

4.1.beta1

### System information

Godot v4.1.beta1 - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 31.0.15.2802) - 11th Gen Intel(R) Core(TM) i5-11400F @ 2.60GHz (12 Threads)

### Issue description

The agent finds the correct path between a and b.

Then the scene is rotated 180 degress.

Now the agent is taking a longer path than it needs to.

https://github.com/godotengine/godot/assets/6430599/3fa04c4f-49a0-468d-9d4c-4a12dee3cb5b



### Steps to reproduce

Download project. Press "a" and "d" to rotate the scene around the z axis.

### Minimal reproduction project

[movenav.zip](https://github.com/godotengine/godot/files/11725682/movenav.zip)

p.points.resize(mesh_poly.size());
		p.edges.resize(mesh_poly.size());
		Vector3 center;
		real_t sum(0);
		for (int j(0); j < mesh_poly.size(); j++) {
			int idx = indices[j];
			if (idx < 0 || idx >= len) {
				valid = false;
				break;
			}
			Vector3 point_position = transform.xform(vertices_r[idx]);
			p.points[j].pos = point_position;
			p.points[j].key = map->get_point_key(point_position);
			center += point_position; 
			if (j >= 2) {
				Vector3 epa = transform.xform(vertices_r[indices[j - 2]]);
				Vector3 epb = transform.xform(vertices_r[indices[j - 1]]);
				sum += map->get_up().dot((epb - epa).cross(point_position - epa));
			}
		}
		if (!valid) {
			ERR_BREAK_MSG(!valid, "The navigation mesh set in this region is not valid!");
		}
		p.clockwise = sum > 0;
		if (mesh_poly.size() != 0) {
			p.center = center / real_t(mesh_poly.size());
		}
	}
}