### 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
HashMap<Node *, NodePath> path_renames;
	Vector<StringName> base_path;
	Node *n = p_node->get_parent();
	while (n) {
		base_path.push_back(n->get_name());
		n = n->get_parent();
	}
	base_path.reverse();
	Vector<StringName> new_base_path = base_path;
	base_path.push_back(p_node->get_name());
	new_base_path.push_back(p_new_name);
	NodePath new_path(new_base_path, true);
	path_renames[p_node] = new_path;
	for (int i = 0; i < p_node->get_child_count(); i++) {
		_fill_path_renames(base_path, new_base_path, p_node->get_child(i), &path_renames);
	}
	perform_node_renames(nullptr, &path_renames);
}
bool SceneTreeDock::_validate_no_foreign() {