### Godot version

v4.1.rc2.mono.official [46424488e]

### System information

Windows 11 - v4.1.rc2 - Vulkan

### Issue description

I tried to move a RichTextLabel into a CenterContainer node and the editor crashed.

It seems the latest working version was **v4.1.beta2.mono.official [a2575cba4]**
I have a crash with all the snapshots that came after that one.

`ERROR: Failed method: CanvasItem::_redraw_callback. Message queue out of memory. Message queue out of memory. Try increasing 'memory.
   at: push_callablep (core/object/message_queue.cpp:96)
ERROR: Failed method: CanvasItem::_redraw_callback. Message queue out of memory. Message queue out of memory. Try increasing 'memory.
   at: push_callablep (core/object/message_queue.cpp:96)
ERROR: Failed method: CanvasItem::_redraw_callback. Message queue out of memory. Message queue out of memory. Try increasing 'memory.
   at: push_callablep (core/object/message_queue.cpp:96)
ERROR: Failed method: CanvasItem::_redraw_callback. Message queue out of memory. Message queue out of memory. Try increasing 'memory.
   at: push_callablep (core/object/message_queue.cpp:96)
ERROR: Failed method: EditorToaster::_error_handler_impl. Message queue out of memory. Message queue out of memory. Try increasing '.
   at: push_callablep (core/object/message_queue.cpp:96)
ERROR: Failed method: EditorToaster::_error_handler_impl. Message queue out of memory. Message queue out of memory. Try increasing '.`

### Steps to reproduce

- Open the project and the main scene
- Move the RichTextLabel into the CenterContainer
- Editor should crash 

### Minimal reproduction project

[bug-ui.zip](https://github.com/godotengine/godot/files/11926495/bug-ui.zip)

Item *item = p_item;
	Item *prev_item = p_item;
	int level = 0;
	while (item) {
		if (item->type == ITEM_LIST) {
			ItemList *list = static_cast<ItemList *>(item);
			ItemFrame *frame = nullptr;
			int line = -1;
			_find_frame(list, &frame, &line);
			int index = 1;
			if (frame != nullptr) {
				for (int i = list->line + 1; i <= prev_item->line && i < (int)frame->lines.size(); i++) {
					if (_find_list_item(frame->lines[i].from) == list) {
						index++;
					}
				}
			}
			r_index.push_back(index);
			r_list.push_back(list);
			prev_item = item;
		}
		level++;
		item = item->parent;
	}
	return level;
}
int RichTextLabel::_find_margin(Item *p_item, const Ref<Font> &p_base_font, int p_base_font_size) {