### 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
if (p_button != MouseButton::RIGHT) {
		return;
	}
	_rmb_select(p_pos);
}
void SceneTreeEditor::_rmb_select(const Vector2 &p_pos, MouseButton p_button) {
	if (p_button != MouseButton::RIGHT) {
		return;
	}
	emit_signal(SNAME("rmb_pressed"), tree->get_screen_position() + p_pos);
}
void SceneTreeEditor::update_warning() {
	_warning_changed(nullptr);
}
void SceneTreeEditor::_warning_changed(Node *p_for_node) {
	//should use a timer
	update_timer->start();
}
void SceneTreeEditor::set_auto_expand_selected(bool p_auto, bool p_update_settings) {
	if (p_update_settings) {
		EditorSettings::get_singleton()->set("docks/scene_tree/auto_expand_to_selected", p_auto);
	}
	auto_expand_selected = p_auto;
}
void SceneTreeEditor::set_connect_to_script_mode(bool p_enable) {