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

return transpose;
}
void TileData::set_texture_origin(Vector2i p_texture_origin) {
	texture_origin = p_texture_origin;
	emit_signal(SNAME("changed"));
}
Vector2i TileData::get_texture_origin() const {
	return texture_origin;
}
void TileData::set_material(Ref<Material> p_material) {
	material = p_material;
	emit_signal(SNAME("changed"));
}
Ref<Material> TileData::get_material() const {
	return material;
}
void TileData::set_modulate(Color p_modulate) {
	modulate = p_modulate;
	emit_signal(SNAME("changed"));
}
Color TileData::get_modulate() const {
	return modulate;
}
void TileData::set_z_index(int p_z_index) {
	z_index = p_z_index;
	emit_signal(SNAME("changed"));
}
int TileData::get_z_index() const {