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

VisualShader::Type type = VisualShader::Type::TYPE_MAX;
		int node = 0;
		Vector2 from;
		Vector2 to;
	};
	List<DragOp> drag_buffer;
	bool drag_dirty = false;
	void _node_dragged(const Vector2 &p_from, const Vector2 &p_to, int p_node);
	void _nodes_dragged();
	bool updating = false;
	void _connection_request(const String &p_from, int p_from_index, const String &p_to, int p_to_index);
	void _disconnection_request(const String &p_from, int p_from_index, const String &p_to, int p_to_index);
	void _scroll_changed(const Vector2 &p_scroll);
	void _node_selected(Object *p_node);
	void _delete_nodes(int p_type, const List<int> &p_nodes);
	void _delete_node_request(int p_type, int p_node);
	void _delete_nodes_request(const TypedArray<StringName> &p_nodes);
	void _node_changed(int p_id);
	void _edit_port_default_input(Object *p_button, int p_node, int p_port);
	void _port_edited(const StringName &p_property, const Variant &p_value, const String &p_field, bool p_changing);
	int to_node = -1;
	int to_slot = -1;
	int from_node = -1;
	int from_slot = -1;
	HashSet<int> selected_constants;
	HashSet<int> selected_parameters;
	int selected_comment = -1;
	int selected_float_constant = -1;
	void _convert_constants_to_parameters(bool p_vice_versa);
	void _replace_node(VisualShader::Type p_type_id, int p_node_id, const StringName &p_from, const StringName &p_to);