### Godot version

v4.0.beta10.official [d0398f62f]

### System information

Windows 11, Vulkan, Intel Iris Xe Graphics

### Issue description

The use of ParameterRef nodes in Visual Shader Graphs can lead to various crashes. Here are a few cases I was able to identify. Since they're all very much related, I figured it would be best to group them in this one report.

### Steps to reproduce

It's not necessary to use the included test file, because this can be done in any empty project, but I attached one just in case.
Double-click shader.tres to open the empty shader graph, then follow the instructions in one of the following bullet points. Each one of them leads to a crash:

- First, add a ParameterRef node to your shader graph. Then add a Parameter node of any type.
- Add a Parameter node of any type. Add one ParameterRef node. Delete the Parameter node. Ctrl+Z to undo the last step.
- Add a Parameter node of any type. Add at least two ParameterRef nodes. Delete the Parameter node.
- Add a Parameter node of any type. Add a ParameterRef node. Enter a new name for the Parameter node that is wider (in terms of pixels) than the previous one, and press Enter. (In some rare cases, the last step needs to be repeated once. Probably has to do with whether or not the user saved the shader inbetween the steps.)
- Add a Parameter node of any type. Add a ParameterRef node. Enter a new name for the Parameter node that is shorter (in terms of pixels) than the previous one and press "Enter". Then change the name again in the same way.

### Minimal reproduction project

[ShaderCrash.zip](https://github.com/godotengine/godot/files/10299297/ShaderCrash.zip)

static List<CopyItem> copy_items_buffer;
	static List<VisualShader::Connection> copy_connections_buffer;
	void _clear_copy_buffer();
	void _copy_nodes(bool p_cut);
	void _paste_nodes(bool p_use_custom_position = false, const Vector2 &p_custom_position = Vector2());
	Vector<Ref<VisualShaderNodePlugin>> plugins;
	Ref<VisualShaderGraphPlugin> graph_plugin;
	void _mode_selected(int p_id);
	void _custom_mode_toggled(bool p_enabled);
	void _input_select_item(Ref<VisualShaderNodeInput> input, String name);
	void _parameter_ref_select_item(Ref<VisualShaderNodeParameterRef> p_parameter_ref, String p_name);
	void _varying_select_item(Ref<VisualShaderNodeVarying> p_varying, String p_name);
	void _float_constant_selected(int p_which);
	VisualShader::Type get_current_shader_type() const;
	void _add_input_port(int p_node, int p_port, int p_port_type, const String &p_name);
	void _remove_input_port(int p_node, int p_port);
	void _change_input_port_type(int p_type, int p_node, int p_port);
	void _change_input_port_name(const String &p_text, Object *p_line_edit, int p_node, int p_port);
	void _add_output_port(int p_node, int p_port, int p_port_type, const String &p_name);
	void _remove_output_port(int p_node, int p_port);
	void _change_output_port_type(int p_type, int p_node, int p_port);
	void _change_output_port_name(const String &p_text, Object *p_line_edit, int p_node, int p_port);
	void _expand_output_port(int p_node, int p_port, bool p_expand);
	void _expression_focus_out(Object *code_edit, int p_node);
	void _set_node_size(int p_type, int p_node, const Size2 &p_size);
	void _node_resized(const Vector2 &p_new_size, int p_type, int p_node);
	void _preview_select_port(int p_node, int p_port);
	void _graph_gui_input(const Ref<InputEvent> &p_event);
	void _member_filter_changed(const String &p_text);
	void _sbox_input(const Ref<InputEvent> &p_ie);