### Godot version

4.0 fb10f45

### System information

Windows 10 x64

### Issue description

Behold, empty TileSet editor, with no TileMap node nor bottom button visible:
![image](https://github.com/godotengine/godot/assets/2223172/0f052770-4946-40eb-a790-a995dbe2599c)
Regression from #72277 (most likely, I didn't test)

### Steps to reproduce

1. Add some Node to your scene
2. Add a TileMap as a child
3. Select TileMap
4. Fold its parent in the scene tree
5. Restart the editor
6. The TileMap selection is restored and so is the folded node, resulting in a weird paradox

### Minimal reproduction project

N/A
if (get_tree()->is_connected("process_frame", callable_mp(this, &AnimationPlayerEditor::_prepare_onion_layers_1_deferred))) {
		get_tree()->disconnect("process_frame", callable_mp(this, &AnimationPlayerEditor::_prepare_onion_layers_1_deferred));
		_free_onion_layers();
		
		onion.can_overlay = false;
		plugin->update_overlays();
	}
}
void AnimationPlayerEditor::_pin_pressed() {
	SceneTreeDock::get_singleton()->get_tree_editor()->update_tree();
}
bool AnimationPlayerEditor::_validate_tracks(const Ref<Animation> p_anim) {
	bool is_valid = true;
	if (!p_anim.is_valid()) {
		return true; 
	}
	int len = p_anim->get_track_count();
	for (int i = 0; i < len; i++) {
		Animation::TrackType ttype = p_anim->track_get_type(i);
		if (ttype == Animation::TYPE_ROTATION_3D) {
			int key_len = p_anim->track_get_key_count(i);
			for (int j = 0; j < key_len; j++) {
				Quaternion q;
				p_anim->rotation_track_get_key(i, j, &q);
				ERR_BREAK_EDMSG(!q.is_normalized(), "AnimationPlayer: '" + player->get_name() + "', Animation: '" + player->get_current_animation() + "', 3D Rotation Track:  '" + p_anim->track_get_path(i) + "' contains unnormalized Quaternion key.");
			}
		} else if (ttype == Animation::TYPE_VALUE) {
			int key_len = p_anim->track_get_key_count(i);