### 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, cells.size(), String());
	ERR_FAIL_INDEX_V(p_index, cells[p_column].buttons.size(), String());
	return cells[p_column].buttons[p_index].tooltip;
}
int TreeItem::get_button_id(int p_column, int p_index) const {
	ERR_FAIL_INDEX_V(p_column, cells.size(), -1);
	ERR_FAIL_INDEX_V(p_index, cells[p_column].buttons.size(), -1);
	return cells[p_column].buttons[p_index].id;
}
void TreeItem::erase_button(int p_column, int p_index) {
	ERR_FAIL_INDEX(p_column, cells.size());
	ERR_FAIL_INDEX(p_index, cells[p_column].buttons.size());
	cells.write[p_column].buttons.remove_at(p_index);
	_changed_notify(p_column);
}
int TreeItem::get_button_by_id(int p_column, int p_id) const {
	ERR_FAIL_INDEX_V(p_column, cells.size(), -1);
	for (int i = 0; i < cells[p_column].buttons.size(); i++) {
		if (cells[p_column].buttons[i].id == p_id) {
			return i;
		}
	}
	return -1;
}
void TreeItem::set_button_tooltip_text(int p_column, int p_index, const String &p_tooltip) {
	ERR_FAIL_INDEX(p_column, cells.size());
	ERR_FAIL_INDEX(p_index, cells[p_column].buttons.size());
	cells.write[p_column].buttons.write[p_index].tooltip = p_tooltip;
}
void TreeItem::set_button(int p_column, int p_index, const Ref<Texture2D> &p_button) {