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

ERR_FAIL_INDEX_V(p_column, columns.size(), false);
	return columns[p_column].expand;
}
int Tree::get_column_expand_ratio(int p_column) const {
	ERR_FAIL_INDEX_V(p_column, columns.size(), 1);
	return columns[p_column].expand_ratio;
}
bool Tree::is_column_clipping_content(int p_column) const {
	ERR_FAIL_INDEX_V(p_column, columns.size(), false);
	return columns[p_column].clip_content;
}
TreeItem *Tree::get_selected() const {
	return selected_item;
}
void Tree::set_selected(TreeItem *p_item, int p_column) {
	ERR_FAIL_INDEX(p_column, columns.size());
	ERR_FAIL_NULL(p_item);
	ERR_FAIL_COND_MSG(p_item->get_tree() != this, "The provided TreeItem does not belong to this Tree. Ensure that the TreeItem is a part of the Tree before setting it as selected.");
	select_single_item(p_item, get_root(), p_column);
}
int Tree::get_selected_column() const {
	return selected_col;
}
TreeItem *Tree::get_edited() const {
	return edited_item;
}
int Tree::get_edited_column() const {
	return edited_col;
}
TreeItem *Tree::get_next_selected(TreeItem *p_item) {