### Godot version

v4.0.beta17.mono.official [c40020513]

### System information

Window 11, Forward+, GTX 1060

### Issue description

Adding two theme variations in a row result to a  crash.

https://user-images.githubusercontent.com/93253123/217037249-1ce1d56d-beb6-4435-83ad-9f8a07fe0e96.mp4



### Steps to reproduce

1. Create a project.
2. Create a theme.
3. Double click to go in the theme editor.
4. Click on manage items buttons.
5. In the add type field type a name to add a type.
6. type another name to add a second type.
7. Crash.

### Minimal reproduction project

[ThemeVariationCrash.zip](https://github.com/godotengine/godot/files/10665863/ThemeVariationCrash.zip)

theme_edit_button->set_tooltip_text(TTR("Add, remove, organize and import Theme items."));
	theme_edit_button->set_flat(true);
	theme_edit_button->connect("pressed", callable_mp(this, &ThemeEditor::_theme_edit_button_cbk));
	top_menu->add_child(theme_edit_button);
	theme_type_editor = memnew(ThemeTypeEditor);
	theme_edit_dialog = memnew(ThemeItemEditorDialog(theme_type_editor));
	theme_edit_dialog->hide();
	top_menu->add_child(theme_edit_dialog);
	HSplitContainer *main_hs = memnew(HSplitContainer);
	main_hs->set_v_size_flags(SIZE_EXPAND_FILL);
	add_child(main_hs);
	VBoxContainer *preview_tabs_vb = memnew(VBoxContainer);
	preview_tabs_vb->set_h_size_flags(SIZE_EXPAND_FILL);
	preview_tabs_vb->set_custom_minimum_size(Size2(520, 0) * EDSCALE);
	preview_tabs_vb->add_theme_constant_override("separation", 2 * EDSCALE);
	main_hs->add_child(preview_tabs_vb);
	HBoxContainer *preview_tabbar_hb = memnew(HBoxContainer);
	preview_tabs_vb->add_child(preview_tabbar_hb);
	preview_tabs_content = memnew(PanelContainer);
	preview_tabs_content->set_v_size_flags(SIZE_EXPAND_FILL);
	preview_tabs_content->set_draw_behind_parent(true);
	preview_tabs_vb->add_child(preview_tabs_content);
	preview_tabs = memnew(TabBar);
	preview_tabs->set_h_size_flags(SIZE_EXPAND_FILL);
	preview_tabbar_hb->add_child(preview_tabs);
	preview_tabs->connect("tab_changed", callable_mp(this, &ThemeEditor::_change_preview_tab));
	preview_tabs->connect("tab_button_pressed", callable_mp(this, &ThemeEditor::_remove_preview_tab));
	HBoxContainer *add_preview_button_hb = memnew(HBoxContainer);
	preview_tabbar_hb->add_child(add_preview_button_hb);
	add_preview_button = memnew(Button);