### Godot version

4.1.beta1

### System information

macOS 13.3.1 mobile renderer

### Issue description

Trying to open and edit one of my visual shaders now consistently crashes Godot 4.1beta1. 

The shader was made and edited fine in earlier versions of Godot 4 and I'm not certain what is special with this shader (attached below for investigation). Opening and editing other visual shaders works fine for me. The only thing I can think of that this shader uses that other do not is the gradient node, though as I can't open it I'm not sure what else might be going on in it.

### Steps to reproduce

Open the attached visual shader (in any project)

### Minimal reproduction project

[ConnectBlendShader.tres.zip](https://www.lostminds.com/godot/ConnectBlendShader.tres.zip)
grabbing = GRAB_NONE;
		} else if (grabbing == GRAB_ADD) {
			
			Vector2 new_pos = curve->get_point_position(selected_index);
			curve->remove_point(selected_index);
			add_point(new_pos);
			grabbing = GRAB_NONE;
		}
		queue_redraw();
	}
	Ref<InputEventMouseMotion> mm = p_event;
	if (mm.is_valid()) {
		Vector2 mpos = mm->get_position();
		if (grabbing != GRAB_NONE && curve.is_valid()) {
			if (selected_index != -1) {
				if (selected_tangent_index == TANGENT_NONE) {
					
					Vector2 new_pos = get_world_pos(mpos).clamp(Vector2(0.0, curve->get_min_value()), Vector2(1.0, curve->get_max_value()));
					if (snap_enabled || mm->is_ctrl_pressed()) {
						new_pos.x = Math::snapped(new_pos.x, 1.0 / snap_count);
						new_pos.y = Math::snapped(new_pos.y - curve->get_min_value(), curve->get_range() / snap_count) + curve->get_min_value();
					}
					
					if (mm->is_shift_pressed()) {
						Vector2 initial_mpos = get_view_pos(initial_grab_pos);
						if (Math::abs(mpos.x - initial_mpos.x) > Math::abs(mpos.y - initial_mpos.y)) {
							new_pos.y = initial_grab_pos.y;
						} else {
							new_pos.x = initial_grab_pos.x;
						}