### Godot version

3.5.2 RC2

### System information

Windows 10

### Issue description

If a gridmap is hidden in the editor and `get_tree().reload_current_scene()` is used, the gridmap will reappear on reset. Using `hide()` or `visible = false` in `_ready()` will not work:
![image](https://github.com/godotengine/godot/assets/16231628/1843f94c-1106-4f6a-ba97-4063174d8714)

The only fix is to use:
![image](https://github.com/godotengine/godot/assets/16231628/e2392aa2-3e79-4d43-bc92-0457319a4b60)


```swift
func _ready():
    show()
    hide()
```

### Steps to reproduce

- Add a gridmap node
- Set visibility in editor to false
- Use `get_tree().reload_current_scene()`

### Minimal reproduction project

[brokenhideshow.zip](https://github.com/godotengine/godot/files/12441673/brokenhideshow.zip)

}
	if (!g.navigation_debug_edge_connections_instance.is_valid()) {
		g.navigation_debug_edge_connections_instance = RenderingServer::get_singleton()->instance_create();
	}
	if (!g.navigation_debug_edge_connections_mesh.is_valid()) {
		g.navigation_debug_edge_connections_mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
	}
	g.navigation_debug_edge_connections_mesh->clear_surfaces();
	float edge_connection_margin = NavigationServer3D::get_singleton()->map_get_edge_connection_margin(get_world_3d()->get_navigation_map());
	float half_edge_connection_margin = edge_connection_margin * 0.5;
	Vector<Vector3> vertex_array;
	for (KeyValue<IndexKey, Octant::NavigationCell> &F : g.navigation_cell_ids) {
		if (cell_map.has(F.key) && F.value.region.is_valid()) {
			int connections_count = NavigationServer3D::get_singleton()->region_get_connections_count(F.value.region);
			if (connections_count == 0) {
				continue;
			}
			for (int i = 0; i < connections_count; i++) {
				Vector3 connection_pathway_start = NavigationServer3D::get_singleton()->region_get_connection_pathway_start(F.value.region, i);
				Vector3 connection_pathway_end = NavigationServer3D::get_singleton()->region_get_connection_pathway_end(F.value.region, i);
				Vector3 direction_start_end = connection_pathway_start.direction_to(connection_pathway_end);
				Vector3 direction_end_start = connection_pathway_end.direction_to(connection_pathway_start);
				Vector3 start_right_dir = direction_start_end.cross(Vector3(0, 1, 0));
				Vector3 start_left_dir = -start_right_dir;
				Vector3 end_right_dir = direction_end_start.cross(Vector3(0, 1, 0));
				Vector3 end_left_dir = -end_right_dir;
				Vector3 left_start_pos = connection_pathway_start + (start_left_dir * half_edge_connection_margin);
				Vector3 right_start_pos = connection_pathway_start + (start_right_dir * half_edge_connection_margin);
				Vector3 left_end_pos = connection_pathway_end + (end_right_dir * half_edge_connection_margin);
				Vector3 right_end_pos = connection_pathway_end + (end_left_dir * half_edge_connection_margin);