### 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 (rect.has_point(mpos)) {
							if (!edit_selected()) {
								emit_signal(SNAME("item_icon_double_clicked"));
							}
						} else {
							emit_signal(SNAME("item_icon_double_clicked"));
						}
					}
					pressing_for_editor = false;
				}
				if (drag_touching) {
					if (drag_speed == 0) {
						drag_touching_deaccel = false;
						drag_touching = false;
						set_physics_process_internal(false);
					} else {
						drag_touching_deaccel = true;
					}
				}
			}
			if (cache.click_type == Cache::CLICK_BUTTON && cache.click_item != nullptr) {
				
				cache.click_item = get_item_at_position(cache.click_pos);
				emit_signal("button_clicked", cache.click_item, cache.click_column, cache.click_id, mb->get_button_index());
			}
			cache.click_type = Cache::CLICK_NONE;
			cache.click_index = -1;
			cache.click_id = -1;
			cache.click_item = nullptr;
			cache.click_column = 0;