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

return disable_folding;
}
Size2 TreeItem::get_minimum_size(int p_column) {
	ERR_FAIL_INDEX_V(p_column, cells.size(), Size2());
	Tree *parent_tree = get_tree();
	ERR_FAIL_NULL_V(parent_tree, Size2());
	const TreeItem::Cell &cell = cells[p_column];
	if (cell.cached_minimum_size_dirty) {
		Size2 size;
		
		if (!cell.text.is_empty()) {
			if (cell.dirty) {
				parent_tree->update_item_cell(this, p_column);
			}
			Size2 text_size = cell.text_buf->get_size();
			size.width += text_size.width;
			size.height = MAX(size.height, text_size.height);
		}
		
		if (cell.mode == CELL_MODE_CHECK) {
			size.width += parent_tree->theme_cache.checked->get_width() + parent_tree->theme_cache.h_separation;
		}
		if (cell.icon.is_valid()) {
			Size2i icon_size = parent_tree->_get_cell_icon_size(cell);
			size.width += icon_size.width + parent_tree->theme_cache.h_separation;
			size.height = MAX(size.height, icon_size.height);
		}
		
		for (int i = 0; i < cell.buttons.size(); i++) {
			Ref<Texture2D> texture = cell.buttons[i].texture;