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

value_editor->set_max(c.max);
			value_editor->set_step(c.step);
			value_editor->set_value(c.val);
			value_editor->set_exp_ratio(c.expr);
			updating_value_editor = false;
		} else {
			value_editor->hide();
		}
		popup_editor->set_position(popup_rect.position);
		popup_editor->set_size(popup_rect.size);
		popup_editor->popup();
		popup_editor->child_controls_changed();
		line_editor->grab_focus();
		return true;
	} else if (c.mode == TreeItem::CELL_MODE_STRING && c.edit_multiline) {
		line_editor->hide();
		text_editor->clear();
		text_editor->set_text(c.text);
		text_editor->select_all();
		text_editor->show();
		popup_editor->set_position(get_screen_position() + rect.position);
		popup_editor->set_size(rect.size);
		popup_editor->popup();
		popup_editor->child_controls_changed();
		text_editor->grab_focus();
		return true;
	}
	return false;
}
bool Tree::is_editing() {