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

cache.click_item = p_item;
				cache.click_column = col;
				cache.click_pos = click_pos;
				queue_redraw();
				return -1;
			}
			col_width -= w + theme_cache.button_margin;
		}
		if (!p_item->disable_folding && !hide_folding && !p_item->cells[col].editable && !p_item->cells[col].selectable && p_item->get_first_child()) {
			if (enable_recursive_folding && p_mod->is_shift_pressed()) {
				p_item->set_collapsed_recursive(!p_item->is_collapsed());
			} else {
				p_item->set_collapsed(!p_item->is_collapsed());
			}
			return -1; 
		}
		bool already_selected = c.selected;
		bool already_cursor = (p_item == selected_item) && col == selected_col;
		if (p_button == MouseButton::LEFT || (p_button == MouseButton::RIGHT && allow_rmb_select)) {
			
			if (p_double_click && (!c.editable || c.mode == TreeItem::CELL_MODE_CUSTOM || c.mode == TreeItem::CELL_MODE_ICON )) { 
				
				propagate_mouse_activated = true;
				incr_search.clear();
				return -1;
			}
			if (c.selectable) {
				if (select_mode == SELECT_MULTI && p_mod->is_command_or_control_pressed()) {
					if (c.selected && p_button == MouseButton::LEFT) {
						p_item->deselect(col);