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

tree = p_tree;
}
TreeItem::~TreeItem() {
	_unlink_from_tree();
	_change_tree(nullptr);
	validate_cache();
	prev = nullptr;
	clear_children();
}
void Tree::_update_theme_item_cache() {
	Control::_update_theme_item_cache();
	theme_cache.base_scale = get_theme_default_base_scale();
}
Size2 Tree::_get_cell_icon_size(const TreeItem::Cell &p_cell) const {
	Size2i icon_size = p_cell.get_icon_size();
	int max_width = 0;
	if (theme_cache.icon_max_width > 0) {
		max_width = theme_cache.icon_max_width;
	}
	if (p_cell.icon_max_w > 0 && (max_width == 0 || p_cell.icon_max_w < max_width)) {
		max_width = p_cell.icon_max_w;
	}
	if (max_width > 0 && icon_size.width > max_width) {
		icon_size.height = icon_size.height * max_width / icon_size.width;
		icon_size.width = max_width;
	}
	return icon_size;
}
int Tree::compute_item_height(TreeItem *p_item) const {