### 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)
ERR_FAIL_COND(!tile_set.is_valid());
	real_t grab_threshold = EDITOR_GET("editors/polygon_editor/point_grab_radius");
	Color grid_color = EDITOR_GET("editors/tiles_editor/grid_color");
	const Ref<Texture2D> handle = get_editor_theme_icon(SNAME("EditorPathSharpHandle"));
	const Ref<Texture2D> add_handle = get_editor_theme_icon(SNAME("EditorHandleAdd"));
	const Ref<StyleBox> focus_stylebox = get_theme_stylebox(SNAME("Focus"), EditorStringName(EditorStyles));
	
	if (base_control->has_focus()) {
		base_control->draw_style_box(focus_stylebox, Rect2(Vector2(), base_control->get_size()));
	}
	
	Size2 tile_size = tile_set->get_tile_size();
	Transform2D xform;
	xform.set_origin(base_control->get_size() / 2 + panning);
	xform.set_scale(Vector2(editor_zoom_widget->get_zoom(), editor_zoom_widget->get_zoom()));
	base_control->draw_set_transform_matrix(xform);
	
	Transform2D tile_xform;
	tile_xform.set_scale(tile_size);
	tile_set->draw_tile_shape(base_control, tile_xform, Color(1.0, 1.0, 1.0, 0.3), true);
	
	if (background_texture.is_valid()) {
		Size2 region_size = background_region.size;
		if (background_h_flip) {
			region_size.x = -region_size.x;
		}
		if (background_v_flip) {
			region_size.y = -region_size.y;