### 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)
const Ref<InputEventMouseMotion> mm = p_event;
	if (mm.is_valid()) {
		Vector2 mpos = mm->get_position() - offset;
		Handle handle_at_mpos = get_handle_at(mpos);
		if (hovered != handle_at_mpos) {
			hovered = handle_at_mpos;
			queue_redraw();
		}
		if (grabbed == HANDLE_NONE) {
			return;
		}
		Vector2 new_pos = (mpos / size).clamp(Vector2(0, 0), Vector2(1, 1));
		if (snap_enabled || mm->is_ctrl_pressed()) {
			new_pos = new_pos.snapped(Vector2(1.0 / snap_count, 1.0 / snap_count));
		}
		
		if (mm->is_shift_pressed()) {
			Vector2 initial_mpos = initial_grab_pos * size;
			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;
			}
		}
		
		texture->set((grabbed == HANDLE_FROM) ? SNAME("fill_from") : SNAME("fill_to"), new_pos);
	}
}
void GradientTexture2DEdit::set_texture(Ref<GradientTexture2D> &p_texture) {