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

if ((p_item == root && hide_root) || !p_item->is_visible()) {
		return 0;
	}
	ERR_FAIL_COND_V(theme_cache.font.is_null(), 0);
	int height = 0;
	for (int i = 0; i < columns.size(); i++) {
		if (p_item->cells[i].dirty) {
			const_cast<Tree *>(this)->update_item_cell(p_item, i);
		}
		height = MAX(height, p_item->cells[i].text_buf->get_size().y);
		for (int j = 0; j < p_item->cells[i].buttons.size(); j++) {
			Size2i s; 
			s += p_item->cells[i].buttons[j].texture->get_size();
			if (s.height > height) {
				height = s.height;
			}
		}
		switch (p_item->cells[i].mode) {
			case TreeItem::CELL_MODE_CHECK: {
				int check_icon_h = theme_cache.checked->get_height();
				if (height < check_icon_h) {