### Godot version

4.1.stable

### System information

Windows 11 (x64), Intel(R) Core(TM) i5-9400 CPU, Vulkan,  NVIDIA GeForce GTX 1660 Ti driver version 528.24

### Issue description

Every time you right click the Filter Nodes field, it duplicates the 'Filters' section in the dropdown.

https://github.com/godotengine/godot/assets/104696964/b8d867c9-ba31-47c5-91c8-23cfa02f1c89



### Steps to reproduce

Rightclick the Filter Nodes field.

### Minimal reproduction project

N/A
Node *p = p_desired_node;
	bool result = false;
	Vector<Node *> instances;
	while (true) {
		if (p->get_scene_file_path() == p_target_scene_path) {
			result = true;
			break;
		}
		Ref<SceneState> ss = p->get_scene_inherited_state();
		if (ss.is_valid()) {
			String path = ss->get_path();
			Ref<PackedScene> pack_data = ResourceLoader::load(path);
			if (pack_data.is_valid()) {
				p = pack_data->instantiate(PackedScene::GEN_EDIT_STATE_INSTANCE);
				if (!p) {
					continue;
				}
				instances.push_back(p);
			} else {
				break;
			}
		} else {
			break;
		}
	}