### Godot version

4.01

### System information

Windows 10

### Issue description

It seems a tiles Custom Data is cleared/not set when "Local to Scene" is enabled for the TileMap in the Resource section. At least the custom data isn't set by the time of the _ready function in the script attached to the TileMap.

### Steps to reproduce

create TileMap and tileset with custom data and attached script. in _ready method attempt to read custom data from a used cell. 

In Attached project run it. It will print_debug if it found custom data or not. "Local to Scene" is enabled so it will not find the custom data.

### Minimal reproduction project

[TileMapCustomDataLocalBugReproduce.zip](https://github.com/godotengine/godot/files/11470771/TileMapCustomDataLocalBugReproduce.zip)

virtual void notify_tile_data_properties_should_change(){};
	virtual void add_occlusion_layer(int p_index){};
	virtual void move_occlusion_layer(int p_from_index, int p_to_pos){};
	virtual void remove_occlusion_layer(int p_index){};
	virtual void add_physics_layer(int p_index){};
	virtual void move_physics_layer(int p_from_index, int p_to_pos){};
	virtual void remove_physics_layer(int p_index){};
	virtual void add_terrain_set(int p_index){};
	virtual void move_terrain_set(int p_from_index, int p_to_pos){};
	virtual void remove_terrain_set(int p_index){};
	virtual void add_terrain(int p_terrain_set, int p_index){};
	virtual void move_terrain(int p_terrain_set, int p_from_index, int p_to_pos){};
	virtual void remove_terrain(int p_terrain_set, int p_index){};
	virtual void add_navigation_layer(int p_index){};
	virtual void move_navigation_layer(int p_from_index, int p_to_pos){};
	virtual void remove_navigation_layer(int p_index){};
	virtual void add_custom_data_layer(int p_index){};
	virtual void move_custom_data_layer(int p_from_index, int p_to_pos){};
	virtual void remove_custom_data_layer(int p_index){};
	virtual void reset_state() override;
	
	virtual int get_tiles_count() const = 0;
	virtual Vector2i get_tile_id(int tile_index) const = 0;
	virtual bool has_tile(Vector2i p_atlas_coords) const = 0;
	
	virtual int get_alternative_tiles_count(const Vector2i p_atlas_coords) const = 0;
	virtual int get_alternative_tile_id(const Vector2i p_atlas_coords, int p_index) const = 0;
	virtual bool has_alternative_tile(const Vector2i p_atlas_coords, int p_alternative_tile) const = 0;
};
class TileSetAtlasSource : public TileSetSource {