### Godot version

4.1.dev (4d5f10fc3a)

### System information

macOS 13.3.0 - Vulkan (Forward+) - integrated Apple M1 Pro - Apple M1 Pro (8 Threads)

### Issue description

When switching filter without coming back to an empty search those that were not matching the search but are included in the new search and none of their child is included will stay greyed out.

### Steps to reproduce


https://github.com/godotengine/godot/assets/66184050/2901bcfe-7834-4f1a-b71f-3b7ad08c3754



### Minimal reproduction project

N/A
AnimationPlayerEditor::get_singleton()->unpin();
			_update_tree();
		}
	} else if (p_id == BUTTON_GROUP) {
		undo_redo->create_action(TTR("Button Group"));
		if (n->is_class("CanvasItem") || n->is_class("Node3D")) {
			undo_redo->add_do_method(n, "remove_meta", "_edit_group_");
			undo_redo->add_undo_method(n, "set_meta", "_edit_group_", true);
			undo_redo->add_do_method(this, "_update_tree");
			undo_redo->add_undo_method(this, "_update_tree");
			undo_redo->add_do_method(this, "emit_signal", "node_changed");
			undo_redo->add_undo_method(this, "emit_signal", "node_changed");
		}
		undo_redo->commit_action();
	} else if (p_id == BUTTON_WARNING) {
		String config_err = n->get_configuration_warnings_as_string();
		if (config_err.is_empty()) {
			return;
		}
		const PackedInt32Array boundaries = TS->string_get_word_breaks(config_err, "", 80);
		PackedStringArray lines;
		for (int i = 0; i < boundaries.size(); i += 2) {
			const int start = boundaries[i];
			const int end = boundaries[i + 1];
			lines.append(config_err.substr(start, end - start + 1));
		}
		warning->set_text(String("\n").join(lines));
		warning->popup_centered();
	} else if (p_id == BUTTON_SIGNALS) {
		editor_selection->clear();