### 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)
bool _property_can_revert(const StringName &p_name) const;
	bool _property_get_revert(const StringName &p_name, Variant &r_property) const;
	void _notification(int p_what);
	static void _bind_methods();
#ifndef DISABLE_DEPRECATED
	Rect2i _get_used_rect_bind_compat_78328();
	void _set_quadrant_size_compat_81070(int p_quadrant_size);
	int _get_quadrant_size_compat_81070() const;
	static void _bind_compatibility_methods();
#endif
public:
	static Vector2i transform_coords_layout(const Vector2i &p_coords, TileSet::TileOffsetAxis p_offset_axis, TileSet::TileLayout p_from_layout, TileSet::TileLayout p_to_layout);
#ifdef TOOLS_ENABLED
	virtual Rect2 _edit_get_rect() const override;
#endif
#ifndef DISABLE_DEPRECATED
	void force_update(int p_layer);
#endif
	
	void queue_internal_update();
	void _internal_update();
	void set_tileset(const Ref<TileSet> &p_tileset);
	Ref<TileSet> get_tileset() const;
	void set_rendering_quadrant_size(int p_size);
	int get_rendering_quadrant_size() const;
	static void draw_tile(RID p_canvas_item, const Vector2 &p_position, const Ref<TileSet> p_tile_set, int p_atlas_source_id, const Vector2i &p_atlas_coords, int p_alternative_tile, int p_frame = -1, Color p_modulation = Color(1.0, 1.0, 1.0, 1.0), const TileData *p_tile_data_override = nullptr, real_t p_animation_offset = 0.0);
	
	int get_layers_count() const;
	void add_layer(int p_to_pos);
	void move_layer(int p_layer, int p_to_pos);