### 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)

while (scenes.has(next_scene_id)) {
		next_scene_id = (next_scene_id % 1073741823) + 1; 
	};
}
int TileSetScenesCollectionSource::get_tiles_count() const {
	return 1;
}
Vector2i TileSetScenesCollectionSource::get_tile_id(int p_tile_index) const {
	ERR_FAIL_COND_V(p_tile_index != 0, TileSetSource::INVALID_ATLAS_COORDS);
	return Vector2i();
}
bool TileSetScenesCollectionSource::has_tile(Vector2i p_atlas_coords) const {
	return p_atlas_coords == Vector2i();
}
int TileSetScenesCollectionSource::get_alternative_tiles_count(const Vector2i p_atlas_coords) const {
	return scenes_ids.size();
}
int TileSetScenesCollectionSource::get_alternative_tile_id(const Vector2i p_atlas_coords, int p_index) const {
	ERR_FAIL_COND_V(p_atlas_coords != Vector2i(), TileSetSource::INVALID_TILE_ALTERNATIVE);
	ERR_FAIL_INDEX_V(p_index, scenes_ids.size(), TileSetSource::INVALID_TILE_ALTERNATIVE);
	return scenes_ids[p_index];
}
bool TileSetScenesCollectionSource::has_alternative_tile(const Vector2i p_atlas_coords, int p_alternative_tile) const {