### 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)

colors_ptr[end_index + 0] = color2;
				colors_ptr[end_index + 1] = color2;
				
				
				
				points_left_ptr[end_index + 0] = pos + edge_offset;
				points_left_ptr[end_index + 1] = pos + edge_offset + end_border + border;
				points_left_ptr[end_index + 2] = pos + edge_offset + end_border;
				colors_left_ptr[end_index + 0] = color;
				colors_left_ptr[end_index + 1] = color2;
				colors_left_ptr[end_index + 2] = color2;
				points_right_ptr[end_index + 0] = pos - edge_offset;
				points_right_ptr[end_index + 1] = pos - edge_offset + end_border - border;
				points_right_ptr[end_index + 2] = pos - edge_offset + end_border;
				colors_right_ptr[end_index + 0] = color;
				colors_right_ptr[end_index + 1] = color2;
				colors_right_ptr[end_index + 2] = color2;
			}
			prev_segment_dir = segment_dir;
		}
		pline_left->primitive = RS::PRIMITIVE_TRIANGLE_STRIP;
		pline_left->polygon.create(indices, points_left, colors_left);
		pline_right->primitive = RS::PRIMITIVE_TRIANGLE_STRIP;
		pline_right->polygon.create(indices, points_right, colors_right);
	} else {
		
		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);