### 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 true;
		}
	} else if (components.size() == 2 && components[0] == "sources" && components[1].is_valid_int()) {
		
		int source_id = components[1].to_int();
		if (has_source(source_id)) {
			r_ret = get_source(source_id);
			return true;
		} else {
			return false;
		}
	} else if (components.size() == 2 && components[0] == "tile_proxies") {
		if (components[1] == "source_level") {
			Array a;
			for (const KeyValue<int, int> &E : source_level_proxies) {
				a.push_back(E.key);
				a.push_back(E.value);
			}
			r_ret = a;
			return true;
		} else if (components[1] == "coords_level") {
			Array a;
			for (const KeyValue<Array, Array> &E : coords_level_proxies) {
				a.push_back(E.key);
				a.push_back(E.value);
			}
			r_ret = a;
			return true;
		} else if (components[1] == "alternative_level") {
			Array a;