### 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)
for (int i = 1; i < grid_steps.x; i++) {
		real_t x = i * step_size.x;
		draw_line(Vector2(x, min_edge.y), Vector2(x, max_edge.y), grid_color);
	}
	for (int i = 1; i < grid_steps.y; i++) {
		real_t y = curve->get_min_value() + i * step_size.y;
		draw_line(Vector2(min_edge.x, y), Vector2(max_edge.x, y), grid_color);
	}
	
	draw_set_transform_matrix(Transform2D());
	Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
	int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
	float font_height = font->get_height(font_size);
	Color text_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
	for (int i = 0; i <= grid_steps.x; ++i) {
		real_t x = i * step_size.x;
		draw_string(font, get_view_pos(Vector2(x - step_size.x / 2, curve->get_min_value())) + Vector2(0, font_height - Math::round(2 * EDSCALE)), String::num(x, 2), HORIZONTAL_ALIGNMENT_CENTER, get_view_pos(Vector2(step_size.x, 0)).x, font_size, text_color);
	}
	for (int i = 0; i <= grid_steps.y; ++i) {
		real_t y = curve->get_min_value() + i * step_size.y;
		draw_string(font, get_view_pos(Vector2(0, y)) + Vector2(2, -2), String::num(y, 2), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color);
	}
	
	
	
	draw_set_transform_matrix(Transform2D(0, get_view_pos(Vector2(0, 0))));
	const Color line_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
	const Color edge_line_color = get_theme_color(SNAME("font_color"), SNAME("Editor")) * Color(1, 1, 1, 0.75);
	CanvasItemPlotCurve plot_func(*this, line_color, edge_line_color);
	plot_curve_accurate(**curve, 2.f, (get_view_pos(Vector2(1, curve->get_max_value())) - get_view_pos(Vector2(0, curve->get_min_value()))) / Vector2(1, curve->get_range()), plot_func);