### Godot version

v4.0.3.stable.official [5222a99f5]

### System information

Mac

### Issue description

The following code will not print any vertices, nor polygons. 
The `NavigationMesh` resource will not be saved correctly.

Even though we specify `bake_navigation_mesh(false)` (on the main thread)

```gdscript
func _ready() -> void:
	var navreg = $NavigationRegion3D
	navreg.bake_navigation_mesh(false)
	
	print(navreg.navmesh.get_vertices())
	print(navreg.navmesh.get_polygon_count())

	var to_save = preload("res://testresource.gd").new(navreg.navmesh)
	ResourceSaver.save(
		to_save,
		"output.tres",
		ResourceSaver.SaverFlags.FLAG_BUNDLE_RESOURCES
	)
```

### Steps to reproduce

1. Download minimal repo below
2. Run the repo
3. Check the console
4. Check `output.tres`

<img width="316" alt="Screenshot 2023-06-03 at 19 05 22" src="https://github.com/godotengine/godot/assets/100964/83ea661d-1c5a-4044-b9cc-2a5434a89280">

<img width="1028" alt="Screenshot 2023-06-03 at 19 05 34" src="https://github.com/godotengine/godot/assets/100964/cb099d0c-f626-48a4-b4f4-9a57b7988df1">


### Minimal reproduction project

[test-navmesh.zip](https://github.com/godotengine/godot/files/11642578/test-navmesh.zip)

if (vertices.size() == 0) {
		return;
	}
	int polygon_count = navigation_mesh->get_polygon_count();
	if (polygon_count == 0) {
		return;
	}
	bool enabled_geometry_face_random_color = NavigationServer3D::get_singleton()->get_debug_navigation_enable_geometry_face_random_color();
	bool enabled_edge_lines = NavigationServer3D::get_singleton()->get_debug_navigation_enable_edge_lines();
	int vertex_count = 0;
	int line_count = 0;
	for (int i = 0; i < polygon_count; i++) {
		const Vector<int> &polygon = navigation_mesh->get_polygon(i);
		int polygon_size = polygon.size();
		if (polygon_size < 3) {
			continue;
		}
		line_count += polygon_size * 2;
		vertex_count += (polygon_size - 2) * 3;
	}
	Vector<Vector3> face_vertex_array;
	face_vertex_array.resize(vertex_count);
	Vector<Color> face_color_array;
	if (enabled_geometry_face_random_color) {
		face_color_array.resize(vertex_count);
	}
	Vector<Vector3> line_vertex_array;
	if (enabled_edge_lines) {
		line_vertex_array.resize(line_count);
	}