### 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)

Color debug_navigation_geometry_face_color = NavigationServer3D::get_singleton()->get_debug_navigation_geometry_face_color();
	RandomPCG rand;
	Color polygon_color = debug_navigation_geometry_face_color;
	int face_vertex_index = 0;
	int line_vertex_index = 0;
	Vector3 *face_vertex_array_ptrw = face_vertex_array.ptrw();
	Color *face_color_array_ptrw = face_color_array.ptrw();
	Vector3 *line_vertex_array_ptrw = line_vertex_array.ptrw();
	for (int polygon_index = 0; polygon_index < polygon_count; polygon_index++) {
		const Vector<int> &polygon_indices = navigation_mesh->get_polygon(polygon_index);
		int polygon_indices_size = polygon_indices.size();
		if (polygon_indices_size < 3) {
			continue;
		}
		if (enabled_geometry_face_random_color) {
			
			polygon_color.set_hsv(debug_navigation_geometry_face_color.get_h() + rand.random(-1.0, 1.0) * 0.1, debug_navigation_geometry_face_color.get_s(), debug_navigation_geometry_face_color.get_v() + rand.random(-1.0, 1.0) * 0.2);
			polygon_color.a = debug_navigation_geometry_face_color.a;
		}
		for (int polygon_indices_index = 0; polygon_indices_index < polygon_indices_size - 2; polygon_indices_index++) {
			face_vertex_array_ptrw[face_vertex_index] = vertices[polygon_indices[0]];
			face_vertex_array_ptrw[face_vertex_index + 1] = vertices[polygon_indices[polygon_indices_index + 1]];
			face_vertex_array_ptrw[face_vertex_index + 2] = vertices[polygon_indices[polygon_indices_index + 2]];
			if (enabled_geometry_face_random_color) {
				face_color_array_ptrw[face_vertex_index] = polygon_color;
				face_color_array_ptrw[face_vertex_index + 1] = polygon_color;
				face_color_array_ptrw[face_vertex_index + 2] = polygon_color;
			}
			face_vertex_index += 3;
		}