### Godot version

4.2 Stable

### System information

Linux

### Issue description

Calling TreeItem set_text() on a TreeItem that was removed via remove_child() causes debugging to end and the application to close without any error message.

### Steps to reproduce

Run the included example to get the debugger to crash. Comment out "treeItem.remove_child(subTreeItem)" for normal behaviour. 

### Minimal reproduction project

[treeItemCrash.zip](https://github.com/godotengine/godot/files/13534005/treeItemCrash.zip)

ERR_FAIL_COND(theme_cache.font.is_null());
	Rect2i rect = p_rect.grow_individual(-theme_cache.inner_item_margin_left, -theme_cache.inner_item_margin_top, -theme_cache.inner_item_margin_right, -theme_cache.inner_item_margin_bottom);
	Size2 ts = p_cell.text_buf->get_size();
	bool rtl = is_layout_rtl();
	int w = 0;
	Size2i bmsize;
	if (!p_cell.icon.is_null()) {
		bmsize = _get_cell_icon_size(p_cell);
		w += bmsize.width + theme_cache.h_separation;
		if (rect.size.width > 0 && (w + ts.width) > rect.size.width) {
			ts.width = rect.size.width - w;
		}
	}
	w += ts.width;
	switch (p_cell.text_alignment) {
		case HORIZONTAL_ALIGNMENT_FILL:
		case HORIZONTAL_ALIGNMENT_LEFT: {
			if (rtl) {
				rect.position.x += MAX(0, (rect.size.width - w));
			}
		} break;
		case HORIZONTAL_ALIGNMENT_CENTER:
			rect.position.x += MAX(0, (rect.size.width - w) / 2);
			break;
		case HORIZONTAL_ALIGNMENT_RIGHT:
			if (!rtl) {