### Godot version

v4.2.beta2.official [f8818f85e]

### System information

Windows 10, 64bit

### Issue description

Some times can't add node in visualshader editor

### Steps to reproduce

1. Open a VisualShader file for edit.
2. Click the `Add Node...` button, it will popup menu, it is OK.
3. Direct close the menu.
4. Clikd the `Add Node...` again, the menu can't popup.
![GIF](https://github.com/godotengine/godot/assets/35988767/1326c63e-3e05-4423-9ec7-7ce305b3f4f5)

### Minimal reproduction project

/
return add_options[p_idx].description;
}
void VisualShaderEditor::_update_options_menu() {
	node_desc->set_text("");
	members_dialog->get_ok_button()->set_disabled(true);
	members->clear();
	TreeItem *root = members->create_item();
	String filter = node_filter->get_text().strip_edges();
	bool use_filter = !filter.is_empty();
	bool is_first_item = true;
	Color unsupported_color = get_theme_color(SNAME("error_color"), EditorStringName(Editor));
	Color supported_color = get_theme_color(SNAME("warning_color"), EditorStringName(Editor));
	static bool low_driver = GLOBAL_GET("rendering/renderer/rendering_method") == "gl_compatibility";
	HashMap<String, TreeItem *> folders;
	int current_func = -1;
	if (!visual_shader.is_null()) {
		current_func = visual_shader->get_mode();
	}
	Vector<AddOption> custom_options;
	Vector<AddOption> embedded_options;
	static Vector<String> type_filter_exceptions;
	if (type_filter_exceptions.is_empty()) {
		type_filter_exceptions.append("VisualShaderNodeExpression");
	}
	for (int i = 0; i < add_options.size(); i++) {
		if (!use_filter || add_options[i].name.findn(filter) != -1) {
			
			if (members_output_port_type != VisualShaderNode::PORT_TYPE_MAX || members_input_port_type != VisualShaderNode::PORT_TYPE_MAX) {
				Ref<VisualShaderNode> vsn;