### Godot version

v4.0.3.stable.mono.official [5222a99f5]

### System information

macOS Monterey 12.6.6 (21G646)

### Issue description

When creating a tileset by code with custom data layers, removing a layer with `remove_custom_data_layer` does not update the name-to-layer mapping; `get_custom_data_layer_by_name` will continue to return that layer's original index.

This has a downstream effect of causing TileData objects attempting to use `get_custom_data('Layer B')` to return invalid data (whatever custom data is now in Layer B's old index; e.g. Layer C).

I would expect that after using `remove_custom_data_layer`, I would be able to still use `get_custom_data_layer_by_name` on that tileset.

### Steps to reproduce

Run this code to see that getting Layer B by name after removing the first layer continues to return its original index (1) when in reality it is now at index 0.
```
	var tileset:TileSet = TileSet.new()

	tileset.add_custom_data_layer()
	tileset.set_custom_data_layer_name(0, 'Layer A')
	tileset.set_custom_data_layer_type(0, TYPE_INT)

	tileset.add_custom_data_layer()
	tileset.set_custom_data_layer_name(1, 'Layer B')
	tileset.set_custom_data_layer_type(1, TYPE_STRING)

	print('Layer index 0 name : ', tileset.get_custom_data_layer_name(0)) # Layer A
	print('Layer index 1 name : ', tileset.get_custom_data_layer_name(1)) # Layer B
	print('Layer B is on index : ', tileset.get_custom_data_layer_by_name("Layer B")) # 1

	print('----- removing custom data layer 0 -----')
	tileset.remove_custom_data_layer(0)

	print('Layer index 0 name : ', tileset.get_custom_data_layer_name(0)) # Layer B
	print('Layer index 1 name : ', tileset.get_custom_data_layer_name(1)) # prints an error, as expected
	print('Layer B is on index : ', tileset.get_custom_data_layer_by_name("Layer B")) # returns 1 still! should return 0.
```

### Minimal reproduction project

[RemoveCustomDataLayer.zip](https://github.com/godotengine/godot/files/11804762/RemoveCustomDataLayer.zip)

ClassDB::bind_method(D_METHOD("set_texture_origin", "texture_origin"), &TileData::set_texture_origin);
	ClassDB::bind_method(D_METHOD("get_texture_origin"), &TileData::get_texture_origin);
	ClassDB::bind_method(D_METHOD("set_modulate", "modulate"), &TileData::set_modulate);
	ClassDB::bind_method(D_METHOD("get_modulate"), &TileData::get_modulate);
	ClassDB::bind_method(D_METHOD("set_z_index", "z_index"), &TileData::set_z_index);
	ClassDB::bind_method(D_METHOD("get_z_index"), &TileData::get_z_index);
	ClassDB::bind_method(D_METHOD("set_y_sort_origin", "y_sort_origin"), &TileData::set_y_sort_origin);
	ClassDB::bind_method(D_METHOD("get_y_sort_origin"), &TileData::get_y_sort_origin);
	ClassDB::bind_method(D_METHOD("set_occluder", "layer_id", "occluder_polygon"), &TileData::set_occluder);
	ClassDB::bind_method(D_METHOD("get_occluder", "layer_id"), &TileData::get_occluder);
	
	ClassDB::bind_method(D_METHOD("set_constant_linear_velocity", "layer_id", "velocity"), &TileData::set_constant_linear_velocity);
	ClassDB::bind_method(D_METHOD("get_constant_linear_velocity", "layer_id"), &TileData::get_constant_linear_velocity);
	ClassDB::bind_method(D_METHOD("set_constant_angular_velocity", "layer_id", "velocity"), &TileData::set_constant_angular_velocity);
	ClassDB::bind_method(D_METHOD("get_constant_angular_velocity", "layer_id"), &TileData::get_constant_angular_velocity);
	ClassDB::bind_method(D_METHOD("set_collision_polygons_count", "layer_id", "polygons_count"), &TileData::set_collision_polygons_count);
	ClassDB::bind_method(D_METHOD("get_collision_polygons_count", "layer_id"), &TileData::get_collision_polygons_count);
	ClassDB::bind_method(D_METHOD("add_collision_polygon", "layer_id"), &TileData::add_collision_polygon);
	ClassDB::bind_method(D_METHOD("remove_collision_polygon", "layer_id", "polygon_index"), &TileData::remove_collision_polygon);
	ClassDB::bind_method(D_METHOD("set_collision_polygon_points", "layer_id", "polygon_index", "polygon"), &TileData::set_collision_polygon_points);
	ClassDB::bind_method(D_METHOD("get_collision_polygon_points", "layer_id", "polygon_index"), &TileData::get_collision_polygon_points);
	ClassDB::bind_method(D_METHOD("set_collision_polygon_one_way", "layer_id", "polygon_index", "one_way"), &TileData::set_collision_polygon_one_way);
	ClassDB::bind_method(D_METHOD("is_collision_polygon_one_way", "layer_id", "polygon_index"), &TileData::is_collision_polygon_one_way);
	ClassDB::bind_method(D_METHOD("set_collision_polygon_one_way_margin", "layer_id", "polygon_index", "one_way_margin"), &TileData::set_collision_polygon_one_way_margin);
	ClassDB::bind_method(D_METHOD("get_collision_polygon_one_way_margin", "layer_id", "polygon_index"), &TileData::get_collision_polygon_one_way_margin);
	
	ClassDB::bind_method(D_METHOD("set_terrain_set", "terrain_set"), &TileData::set_terrain_set);
	ClassDB::bind_method(D_METHOD("get_terrain_set"), &TileData::get_terrain_set);
	ClassDB::bind_method(D_METHOD("set_terrain", "terrain"), &TileData::set_terrain);
	ClassDB::bind_method(D_METHOD("get_terrain"), &TileData::get_terrain);