### Godot version

4.1.beta3

### System information

Godot v4.1.beta3 - macOS 13.2.1 - Vulkan (Forward+) - dedicated AMD Radeon Pro 580 - Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 Threads)

### Issue description

When baking the mesh in GDScript after placing a Node3D (StaticBody3D with CollisionShape3D) these error message are displayed:

```
E 0:00:02:0733   update_polygons: Navigation map synchronization error. Attempted to update a navigation region with a navigation mesh that uses a different `cell_height` than the `cell_height` set on the navigation map.
  <C++ Source>   modules/navigation/nav_region.cpp:114 @ update_polygons()

E 0:00:19:0007   sync: Navigation map synchronization error. Attempted to merge a navigation mesh polygon edge with another already-merged edge. This is usually caused by crossing edges, overlapping polygons, or a mismatch of the NavigationMesh / NavigationPolygon baked 'cell_size' and navigation map 'cell_size'.
  <C++ Source>   modules/navigation/nav_map.cpp:770 @ sync()
```


**In Godot v4.1.beta2 it worked,** i.e. no error message

### Steps to reproduce

GDScript:
```
@onready var _navigationRegion3D: NavigationRegion3D = %NavigationRegion3D

:

_navigationRegion3D.bake_navigation_mesh(false)
```

Properties NavigationRegion3D:
<img width="434" alt="CleanShot 2023-06-22 at 19 15 44@2x" src="https://github.com/godotengine/godot/assets/1539838/30410b5f-99f1-40a4-82d4-2d6d66f673d5">


### Minimal reproduction project

[RTS 3D BakeIssue.zip](https://github.com/godotengine/godot/files/11839898/RTS.3D.BakeIssue.zip)

poly_mesh = rcAllocPolyMesh();
	ERR_FAIL_COND(!poly_mesh);
	ERR_FAIL_COND(!rcBuildPolyMesh(&ctx, *cset, cfg.maxVertsPerPoly, *poly_mesh));
	detail_mesh = rcAllocPolyMeshDetail();
	ERR_FAIL_COND(!detail_mesh);
	ERR_FAIL_COND(!rcBuildPolyMeshDetail(&ctx, *poly_mesh, *chf, cfg.detailSampleDist, cfg.detailSampleMaxError, *detail_mesh));
	rcFreeCompactHeightfield(chf);
	chf = nullptr;
	rcFreeContourSet(cset);
	cset = nullptr;
	bake_state = "Converting to native navigation mesh..."; 
	Vector<Vector3> nav_vertices;
	for (int i = 0; i < detail_mesh->nverts; i++) {
		const float *v = &detail_mesh->verts[i * 3];
		nav_vertices.push_back(Vector3(v[0], v[1], v[2]));
	}
	p_navigation_mesh->set_vertices(nav_vertices);
	for (int i = 0; i < detail_mesh->nmeshes; i++) {
		const unsigned int *detail_mesh_m = &detail_mesh->meshes[i * 4];
		const unsigned int detail_mesh_bverts = detail_mesh_m[0];
		const unsigned int detail_mesh_m_btris = detail_mesh_m[2];
		const unsigned int detail_mesh_ntris = detail_mesh_m[3];
		const unsigned char *detail_mesh_tris = &detail_mesh->tris[detail_mesh_m_btris * 4];
		for (unsigned int j = 0; j < detail_mesh_ntris; j++) {
			Vector<int> nav_indices;
			nav_indices.resize(3);
			
			nav_indices.write[0] = ((int)(detail_mesh_bverts + detail_mesh_tris[j * 4 + 0]));
			nav_indices.write[1] = ((int)(detail_mesh_bverts + detail_mesh_tris[j * 4 + 2]));
			nav_indices.write[2] = ((int)(detail_mesh_bverts + detail_mesh_tris[j * 4 + 1]));