### 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 (i == 0) {
				item_width -= ofs;
				if (item_width <= 0) {
					ofs = get_column_width(0);
					continue;
				}
			} else {
				ofs += theme_cache.h_separation;
				item_width -= theme_cache.h_separation;
			}
			if (p_item->cells[i].expand_right) {
				int plus = 1;
				while (i + plus < columns.size() && !p_item->cells[i + plus].editable && p_item->cells[i + plus].mode == TreeItem::CELL_MODE_STRING && p_item->cells[i + plus].text.is_empty() && p_item->cells[i + plus].icon.is_null()) {
					item_width += get_column_width(i + plus);
					plus++;
					skip2++;
				}
			}
			if (!rtl && p_item->cells[i].buttons.size()) {
				int buttons_width = 0;
				for (int j = p_item->cells[i].buttons.size() - 1; j >= 0; j--) {
					Ref<Texture2D> button_texture = p_item->cells[i].buttons[j].texture;
					buttons_width += button_texture->get_size().width + theme_cache.button_pressed->get_minimum_size().width + theme_cache.button_margin;
				}
				int total_ofs = ofs - theme_cache.offset.x;
				if (total_ofs + item_width > p_draw_size.width) {
					item_width = MAX(buttons_width, p_draw_size.width - total_ofs);
				}
			}
			int item_width_with_buttons = item_width;