### 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 (h_scroll->is_visible_in_tree()) {
			pos.x += h_scroll->get_value();
		}
		if (v_scroll->is_visible_in_tree()) {
			pos.y += v_scroll->get_value();
		}
		int col, h, section;
		TreeItem *it = _find_item_at_pos(root, pos, col, h, section);
		if (it) {
			const TreeItem::Cell &c = it->cells[col];
			for (int j = c.buttons.size() - 1; j >= 0; j--) {
				if (c.buttons[j].rect.has_point(button_pos)) {
					String tooltip = c.buttons[j].tooltip;
					if (!tooltip.is_empty()) {
						return tooltip;
					}
				}
			}
			String ret;
			if (it->get_tooltip_text(col) == "") {
				ret = it->get_text(col);
			} else {
				ret = it->get_tooltip_text(col);
			}
			return ret;
		}
	}
	return Control::get_tooltip(p_pos);
}
void Tree::set_cursor_can_exit_tree(bool p_enable) {