### 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)
}
	if (!show_collision) {
		return;
	}
	RenderingServer *rs = RenderingServer::get_singleton();
	PhysicsServer2D *ps = PhysicsServer2D::get_singleton();
	Color debug_collision_color = tile_map_node->get_tree()->get_debug_collisions_color();
	Vector<Color> color;
	color.push_back(debug_collision_color);
	Transform2D quadrant_to_local(0, p_quadrant_pos);
	Transform2D global_to_quadrant = (tile_map_node->get_global_transform() * quadrant_to_local).affine_inverse();
	for (RID body : r_cell_data.bodies) {
		if (body.is_valid()) {
			Transform2D body_to_quadrant = global_to_quadrant * Transform2D(ps->body_get_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM));
			rs->canvas_item_add_set_transform(p_canvas_item, body_to_quadrant);
			for (int shape_index = 0; shape_index < ps->body_get_shape_count(body); shape_index++) {
				const RID &shape = ps->body_get_shape(body, shape_index);
				const PhysicsServer2D::ShapeType &type = ps->shape_get_type(shape);
				if (type == PhysicsServer2D::SHAPE_CONVEX_POLYGON) {
					rs->canvas_item_add_polygon(p_canvas_item, ps->shape_get_data(shape), color);
				} else {
					WARN_PRINT("Wrong shape type for a tile, should be SHAPE_CONVEX_POLYGON.");
				}
			}
			rs->canvas_item_add_set_transform(p_canvas_item, Transform2D());
		}
	}
};
#endif 
void TileMapLayer::_navigation_update() {