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

Rect2 rect = popup_edited_item->get_meta("__focus_rect");
				popup_editor->set_position(get_global_position() + rect.position);
				popup_editor->set_size(rect.size);
				popup_editor->child_controls_changed();
			}
		} break;
	}
}
void Tree::_update_all() {
	for (int i = 0; i < columns.size(); i++) {
		update_column(i);
	}
	if (root) {
		update_item_cache(root);
	}
}
Size2 Tree::get_minimum_size() const {
	if (h_scroll_enabled && v_scroll_enabled) {
		return Size2();
	} else {
		Vector2 min_size = get_internal_min_size();
		Ref<StyleBox> bg = theme_cache.panel_style;
		if (bg.is_valid()) {
			min_size.x += bg->get_margin(SIDE_LEFT) + bg->get_margin(SIDE_RIGHT);
			min_size.y += bg->get_margin(SIDE_TOP) + bg->get_margin(SIDE_BOTTOM);
		}
		return Vector2(h_scroll_enabled ? 0 : min_size.x, v_scroll_enabled ? 0 : min_size.y);
	}
}
TreeItem *Tree::create_item(TreeItem *p_parent, int p_index) {