### 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) {
				if (p_item->cells[0].selected && select_mode == SELECT_ROW) {
					const Rect2 content_rect = _get_content_rect();
					Rect2i row_rect = Rect2i(Point2i(content_rect.position.x, item_rect.position.y), Size2i(content_rect.size.x, item_rect.size.y));
					if (rtl) {
						row_rect.position.x = get_size().width - row_rect.position.x - row_rect.size.x;
					}
					if (has_focus()) {
						theme_cache.selected_focus->draw(ci, row_rect);
					} else {
						theme_cache.selected->draw(ci, row_rect);
					}
				}
			}
			if ((select_mode == SELECT_ROW && selected_item == p_item) || p_item->cells[i].selected || !p_item->has_meta("__focus_rect")) {
				Rect2i r = cell_rect;
				p_item->set_meta("__focus_rect", Rect2(r.position, r.size));
				if (select_mode != SELECT_ROW) {
					if (rtl) {
						r.position.x = get_size().width - r.position.x - r.size.x;
					}
					if (p_item->cells[i].selected) {
						if (has_focus()) {
							theme_cache.selected_focus->draw(ci, r);
						} else {
							theme_cache.selected->draw(ci, r);
						}
					}
				}
			}