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

click_handled = true;
				return -1;
			} break;
		};
		if (!bring_up_editor || p_button != MouseButton::LEFT) {
			return -1;
		}
		click_handled = true;
		popup_pressing_edited_item = p_item;
		popup_pressing_edited_item_column = col;
		pressing_item_rect = Rect2(get_global_position() + Point2i(col_ofs, _get_title_button_height() + y_ofs) - theme_cache.offset, Size2(col_width, item_h));
		pressing_for_editor_text = editor_text;
		pressing_for_editor = true;
		return -1; 
	} else {
		Point2i new_pos = p_pos;
		if (!skip) {
			x_ofs += theme_cache.item_margin;
			
			y_ofs += item_h;
			new_pos.y -= item_h;
		}
		if (!p_item->collapsed) { 
			TreeItem *c = p_item->first_child;
			while (c) {
				int child_h = propagate_mouse_event(new_pos, x_ofs, y_ofs, x_limit, p_double_click, c, p_button, p_mod);
				if (child_h < 0) {
					return -1; 
				}
				new_pos.y -= child_h;