### 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->item_changed(p_cell, this);
}
void TreeItem::_changed_notify() {
	tree->item_changed(-1, this);
}
void TreeItem::_cell_selected(int p_cell) {
	tree->item_selected(p_cell, this);
}
void TreeItem::_cell_deselected(int p_cell) {
	tree->item_deselected(p_cell, this);
}
void TreeItem::_change_tree(Tree *p_tree) {
	if (p_tree == tree) {
		return;
	}
	TreeItem *c = first_child;
	while (c) {
		c->_change_tree(p_tree);
		c = c->next;
	}
	if (tree) {
		if (tree->root == this) {
			tree->root = nullptr;
		}