### 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)
case PRESET_LINEAR:
			curve->add_point(Vector2(0, min_value));
			curve->add_point(Vector2(1, max_value));
			curve->set_point_right_mode(0, Curve::TANGENT_LINEAR);
			curve->set_point_left_mode(1, Curve::TANGENT_LINEAR);
			break;
		case PRESET_EASE_IN:
			curve->add_point(Vector2(0, min_value));
			curve->add_point(Vector2(1, max_value), curve->get_range() * 1.4, 0);
			break;
		case PRESET_EASE_OUT:
			curve->add_point(Vector2(0, min_value), 0, curve->get_range() * 1.4);
			curve->add_point(Vector2(1, max_value));
			break;
		case PRESET_SMOOTHSTEP:
			curve->add_point(Vector2(0, min_value));
			curve->add_point(Vector2(1, max_value));
			break;
		default:
			break;
	}
	EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
	undo_redo->create_action(TTR("Load Curve Preset"));
	undo_redo->add_do_method(*curve, "_set_data", curve->get_data());
	undo_redo->add_do_method(this, "set_selected_index", -1);
	undo_redo->add_undo_method(*curve, "_set_data", previous_data);
	undo_redo->add_undo_method(this, "set_selected_index", selected_index);
	undo_redo->commit_action();
}
void CurveEdit::_curve_changed() {