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

padded_texture_needs_update = true;
	call_deferred(SNAME("_update_padded_texture"));
}
void TileSetAtlasSource::_update_padded_texture() {
	if (!padded_texture_needs_update) {
		return;
	}
	padded_texture_needs_update = false;
	padded_texture = Ref<ImageTexture>();
	if (!texture.is_valid()) {
		return;
	}
	if (!use_texture_padding) {
		return;
	}
	Size2 size = get_atlas_grid_size() * (texture_region_size + Vector2i(2, 2));
	Ref<Image> src = texture->get_image();
	if (!src.is_valid()) {
		return;
	}