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

first_child = ti;
		if (!children_cache.is_empty()) {
			children_cache.insert(0, ti);
		}
	}
	ti->parent = this;
	return ti;
}
void TreeItem::add_child(TreeItem *p_item) {
	ERR_FAIL_NULL(p_item);
	ERR_FAIL_COND(p_item->tree);
	ERR_FAIL_COND(p_item->parent);
	p_item->_change_tree(tree);
	p_item->parent = this;
	TreeItem *item_prev = first_child;
	while (item_prev && item_prev->next) {
		item_prev = item_prev->next;
	}
	if (item_prev) {
		item_prev->next = p_item;
		p_item->prev = item_prev;
	} else {
		first_child = p_item;
	}
	if (!children_cache.is_empty()) {
		children_cache.append(p_item);
	}
	validate_cache();
}
void TreeItem::remove_child(TreeItem *p_item) {