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

}
				gloff.x += glyphs[i].advance;
			}
		}
		Vector2 fbg_line_off = off + p_ofs;
		
		Vector2i chr_range = TS->shaped_text_get_range(rid);
		_draw_fbg_boxes(ci, rid, fbg_line_off, it_from, it_to, chr_range.x, chr_range.y, 0);
		
		Color selection_bg = theme_cache.selection_color;
		int sel_start = -1;
		int sel_end = -1;
		if (selection.active && (selection.from_frame->lines[selection.from_line].char_offset + selection.from_char) <= (l.char_offset + TS->shaped_text_get_range(rid).y) && (selection.to_frame->lines[selection.to_line].char_offset + selection.to_char) >= (l.char_offset + TS->shaped_text_get_range(rid).x)) {
			sel_start = MAX(TS->shaped_text_get_range(rid).x, (selection.from_frame->lines[selection.from_line].char_offset + selection.from_char) - l.char_offset);
			sel_end = MIN(TS->shaped_text_get_range(rid).y, (selection.to_frame->lines[selection.to_line].char_offset + selection.to_char) - l.char_offset);
			Vector<Vector2> sel = TS->shaped_text_get_selection(rid, sel_start, sel_end);
			for (int i = 0; i < sel.size(); i++) {
				Rect2 rect = Rect2(sel[i].x + p_ofs.x + off.x, p_ofs.y + off.y - TS->shaped_text_get_ascent(rid), sel[i].y - sel[i].x, TS->shaped_text_get_size(rid).y);
				RenderingServer::get_singleton()->canvas_item_add_rect(ci, rect, selection_bg);
			}
		}
		Vector2 ul_start;
		bool ul_started = false;
		Color ul_color;
		Vector2 dot_ul_start;
		bool dot_ul_started = false;
		Color dot_ul_color;
		Vector2 st_start;
		bool st_started = false;
		Color st_color;