### Godot version

v4.1.beta1.official [828ec2c5d]

### System information

Windows 11 Home, v4.1.beta1.official [828ec2c5d], All Renderers, NVidia GeForce RTX 3060 Ti,  Drivers 535.98

### Issue description

When enabling the "Y Sort Enabled" ordering method for a Sprite2D, the sprite will be rendered entirely black.

![grafik](https://github.com/godotengine/godot/assets/29011290/6fa4da16-d9a5-4c3b-a9e4-c1bba53c2183)
![grafik](https://github.com/godotengine/godot/assets/29011290/cbf499ae-f3f7-4c07-98b2-a1a667d810c2)


### Steps to reproduce

Simply create a Sprite2D Node, assign any texture to it and activate Y-Sorting

### Minimal reproduction project

[GDB_4.1_ysort.zip](https://github.com/godotengine/godot/files/11704361/GDB_4.1_ysort.zip)

Vector2 *points_right_ptr = points_right.ptrw();
		Color *colors_right_ptr = colors_right.ptrw();
		Vector2 prev_segment_dir;
		for (int i = 0; i < point_count; i++) {
			bool is_first_point = (i == 0);
			bool is_last_point = (i == point_count - 1);
			Vector2 segment_dir = compute_polyline_segment_dir(p_points, i, prev_segment_dir);
			if (is_first_point && loop) {
				prev_segment_dir = last_segment_dir;
			} else if (is_last_point && loop) {
				prev_segment_dir = first_segment_dir;
			}
			Vector2 base_edge_offset;
			if (is_first_point && !loop) {
				base_edge_offset = first_segment_dir.orthogonal();
			} else if (is_last_point && !loop) {
				base_edge_offset = last_segment_dir.orthogonal();
			} else {
				base_edge_offset = compute_polyline_edge_offset_clamped(segment_dir, prev_segment_dir);
			}
			Vector2 edge_offset = base_edge_offset * (p_width * 0.5f);
			Vector2 border = base_edge_offset * border_size;
			Vector2 pos = p_points[i];
			int j = i * 2 + (loop ? 0 : 2);
			points_ptr[j + 0] = pos + edge_offset;
			points_ptr[j + 1] = pos - edge_offset;
			points_left_ptr[j + 0] = pos + edge_offset;
			points_left_ptr[j + 1] = pos + edge_offset + border;
			points_right_ptr[j + 0] = pos - edge_offset;
			points_right_ptr[j + 1] = pos - edge_offset - border;