### 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
p_menu->clear();
	List<Pair<Ref<Resource>, Node *>> all_resources;
	if (edited_scene) {
		_gather_resources(edited_scene, all_resources);
	}
	HashMap<String, List<Pair<Ref<Resource>, Node *>>> resources_by_type;
	HashMap<Ref<Resource>, int> unique_resources;
	for (const Pair<Ref<Resource>, Node *> &pair : all_resources) {
		if (!unique_resources.has(pair.first)) {
			resources_by_type[pair.first->get_class()].push_back(pair);
		}
		unique_resources[pair.first]++;
	}
	for (KeyValue<String, List<Pair<Ref<Resource>, Node *>>> kv : resources_by_type) {
		p_menu->add_icon_item(EditorNode::get_singleton()->get_class_icon(kv.key), kv.key);