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

BitField<TextServer::LineBreakFlag> break_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_TRIM_EDGE_SPACES;
	switch (p_item->cells.write[p_col].autowrap_mode) {
		case TextServer::AUTOWRAP_OFF:
			break;
		case TextServer::AUTOWRAP_ARBITRARY:
			break_flags.set_flag(TextServer::BREAK_GRAPHEME_BOUND);
			break;
		case TextServer::AUTOWRAP_WORD:
			break_flags.set_flag(TextServer::BREAK_WORD_BOUND);
			break;
		case TextServer::AUTOWRAP_WORD_SMART:
			break_flags.set_flag(TextServer::BREAK_WORD_BOUND);
			break_flags.set_flag(TextServer::BREAK_ADAPTIVE);
			break;
	}
	p_item->cells.write[p_col].text_buf->set_break_flags(break_flags);
	TS->shaped_text_set_bidi_override(p_item->cells[p_col].text_buf->get_rid(), structured_text_parser(p_item->cells[p_col].st_parser, p_item->cells[p_col].st_args, valtext));
	p_item->cells.write[p_col].dirty = false;
}
void Tree::update_item_cache(TreeItem *p_item) {
	for (int i = 0; i < p_item->cells.size(); i++) {
		update_item_cell(p_item, i);
	}
	TreeItem *c = p_item->first_child;
	while (c) {
		update_item_cache(c);
		c = c->next;
	}
}
int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 &p_draw_size, TreeItem *p_item, int &r_self_height) {