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

TreeItem *ti = memnew(TreeItem(tree));
	if (tree) {
		ti->cells.resize(tree->columns.size());
		tree->queue_redraw();
	}
	TreeItem *item_prev = nullptr;
	TreeItem *item_next = first_child;
	int idx = 0;
	while (item_next) {
		if (idx == p_index) {
			item_next->prev = ti;
			ti->next = item_next;
			break;
		}
		item_prev = item_next;
		item_next = item_next->next;
		idx++;
	}
	if (item_prev) {
		item_prev->next = ti;
		ti->prev = item_prev;
		if (!children_cache.is_empty()) {
			if (ti->next) {
				children_cache.insert(p_index, ti);
			} else {
				children_cache.append(ti);
			}
		}
	} else {