### 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_COND(p_button.is_null());
	ERR_FAIL_INDEX(p_column, cells.size());
	ERR_FAIL_INDEX(p_index, cells[p_column].buttons.size());
	if (cells[p_column].buttons[p_index].texture == p_button) {
		return;
	}
	cells.write[p_column].buttons.write[p_index].texture = p_button;
	cells.write[p_column].cached_minimum_size_dirty = true;
	_changed_notify(p_column);
}
void TreeItem::set_button_color(int p_column, int p_index, const Color &p_color) {
	ERR_FAIL_INDEX(p_column, cells.size());
	ERR_FAIL_INDEX(p_index, cells[p_column].buttons.size());
	if (cells[p_column].buttons[p_index].color == p_color) {
		return;
	}
	cells.write[p_column].buttons.write[p_index].color = p_color;
	_changed_notify(p_column);
}
void TreeItem::set_button_disabled(int p_column, int p_index, bool p_disabled) {
	ERR_FAIL_INDEX(p_column, cells.size());
	ERR_FAIL_INDEX(p_index, cells[p_column].buttons.size());
	if (cells[p_column].buttons[p_index].disabled == p_disabled) {
		return;
	}
	cells.write[p_column].buttons.write[p_index].disabled = p_disabled;
	cells.write[p_column].cached_minimum_size_dirty = true;
	_changed_notify(p_column);
}
bool TreeItem::is_button_disabled(int p_column, int p_index) const {