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

Vector<int> source_to_remove;
	for (const KeyValue<int, int> &E : source_level_proxies) {
		if (has_source(E.key)) {
			source_to_remove.push_back(E.key);
		}
	}
	for (int i = 0; i < source_to_remove.size(); i++) {
		remove_source_level_tile_proxy(source_to_remove[i]);
	}
	
	Vector<Array> coords_to_remove;
	for (const KeyValue<Array, Array> &E : coords_level_proxies) {
		Array a = E.key;
		if (has_source(a[0]) && get_source(a[0])->has_tile(a[1])) {
			coords_to_remove.push_back(a);
		}
	}
	for (int i = 0; i < coords_to_remove.size(); i++) {
		Array a = coords_to_remove[i];
		remove_coords_level_tile_proxy(a[0], a[1]);
	}
	
	Vector<Array> alternative_to_remove;
	for (const KeyValue<Array, Array> &E : alternative_level_proxies) {
		Array a = E.key;