### Godot version

4.2 beta 2

### System information

Pop Os 22.04 lts 12th Gen Intel® Core™ i7-12700H × 20 NVIDIA RTX A2000 8GB 32.0  ram. Tested on Forward+ and Mobile

### Issue description

When painting a tile that is rotated or flipped, it looses its physics layer as demonstrated in this video:  

https://github.com/godotengine/godot/assets/33091666/c10f7325-838f-4112-b90d-0c3d9797d08f

Even though in the video I showed this only happening with one of the tiles, it happens with both of them as long as you rotate or flip it. 

### Steps to reproduce

1. Create a tilemap and a tileset
2. Create a physics layer and set collision_visibility_mode to force show. 
3. Assign just created physics layer to tiles
4. Paint the tiles and use rotate or flip tool. 

### Minimal reproduction project

[TileTest.zip](https://github.com/godotengine/godot/files/13067412/TileTest.zip)
baking_navmeshes.insert(p_navigation_mesh);
	baking_navmesh_mutex.unlock();
	generator_task_mutex.lock();
	NavMeshGeneratorTask2D *generator_task = memnew(NavMeshGeneratorTask2D);
	generator_task->navigation_mesh = p_navigation_mesh;
	generator_task->source_geometry_data = p_source_geometry_data;
	generator_task->callback = p_callback;
	generator_task->status = NavMeshGeneratorTask2D::TaskStatus::BAKING_STARTED;
	generator_task->thread_task_id = WorkerThreadPool::get_singleton()->add_native_task(&NavMeshGenerator2D::generator_thread_bake, generator_task, NavMeshGenerator2D::baking_use_high_priority_threads, "NavMeshGeneratorBake2D");
	generator_tasks.insert(generator_task->thread_task_id, generator_task);
	generator_task_mutex.unlock();
}
void NavMeshGenerator2D::generator_thread_bake(void *p_arg) {
	NavMeshGeneratorTask2D *generator_task = static_cast<NavMeshGeneratorTask2D *>(p_arg);
	generator_bake_from_source_geometry_data(generator_task->navigation_mesh, generator_task->source_geometry_data);
	generator_task->status = NavMeshGeneratorTask2D::TaskStatus::BAKING_FINISHED;
}
void NavMeshGenerator2D::generator_parse_geometry_node(Ref<NavigationPolygon> p_navigation_mesh, Ref<NavigationMeshSourceGeometryData2D> p_source_geometry_data, Node *p_node, bool p_recurse_children) {
	generator_parse_meshinstance2d_node(p_navigation_mesh, p_source_geometry_data, p_node);
	generator_parse_multimeshinstance2d_node(p_navigation_mesh, p_source_geometry_data, p_node);
	generator_parse_polygon2d_node(p_navigation_mesh, p_source_geometry_data, p_node);
	generator_parse_staticbody2d_node(p_navigation_mesh, p_source_geometry_data, p_node);
	generator_parse_tilemap_node(p_navigation_mesh, p_source_geometry_data, p_node);
	if (p_recurse_children) {
		for (int i = 0; i < p_node->get_child_count(); i++) {
			generator_parse_geometry_node(p_navigation_mesh, p_source_geometry_data, p_node->get_child(i), p_recurse_children);
		}
	}
}
void NavMeshGenerator2D::generator_parse_meshinstance2d_node(const Ref<NavigationPolygon> &p_navigation_mesh, Ref<NavigationMeshSourceGeometryData2D> p_source_geometry_data, Node *p_node) {