### 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

/
link.input_ports.clear();
	} else {
		register_link(p_type, p_id, vsnode.ptr(), node);
	}
	if (is_resizable) {
		size = resizable_node->get_size();
		node->set_resizable(true);
		node->connect("resize_request", callable_mp(editor, &VisualShaderEditor::_node_resized).bind((int)p_type, p_id));
	}
	if (is_expression) {
		expression = expression_node->get_expression();
	}
	if (is_comment) {
		node->set_visible(false);
	}
	node->set_position_offset(visual_shader->get_node_position(p_type, p_id));
	node->set_name(itos(p_id));
	node->connect("dragged", callable_mp(editor, &VisualShaderEditor::_node_dragged).bind(p_id));
	Control *custom_editor = nullptr;
	int port_offset = 1;
	if (is_resizable) {
		editor->call_deferred(SNAME("_set_node_size"), (int)p_type, p_id, size);
	}
	Control *content_offset = memnew(Control);
	content_offset->set_custom_minimum_size(Size2(0, 5 * EDSCALE));
	node->add_child(content_offset);
	if (is_group) {
		port_offset += 1;
	}
	Ref<VisualShaderNodeParticleEmit> emit = vsnode;