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

for (int i = 0; i < canvas->child_items.size(); i++) {
			canvas->child_items[i].item->parent = RID();
		}
		for (RendererCanvasRender::Light *E : canvas->lights) {
			E->canvas = RID();
		}
		for (RendererCanvasRender::LightOccluderInstance *E : canvas->occluders) {
			E->canvas = RID();
		}
		canvas_owner.free(p_rid);
	} else if (canvas_item_owner.owns(p_rid)) {
		Item *canvas_item = canvas_item_owner.get_or_null(p_rid);
		ERR_FAIL_COND_V(!canvas_item, true);
		if (canvas_item->parent.is_valid()) {
			if (canvas_owner.owns(canvas_item->parent)) {
				Canvas *canvas = canvas_owner.get_or_null(canvas_item->parent);
				canvas->erase_item(canvas_item);
			} else if (canvas_item_owner.owns(canvas_item->parent)) {
				Item *item_owner = canvas_item_owner.get_or_null(canvas_item->parent);
				item_owner->child_items.erase(canvas_item);
				if (item_owner->sort_y) {
					_mark_ysort_dirty(item_owner, canvas_item_owner);
				}
			}
		}
		for (int i = 0; i < canvas_item->child_items.size(); i++) {
			canvas_item->child_items[i]->parent = RID();
		}
		if (canvas_item->visibility_notifier != nullptr) {
			visibility_notifier_allocator.free(canvas_item->visibility_notifier);