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

int tab_index = p_tab_control->get_index();
	_remove_preview_tab(tab_index);
}
void ThemeEditor::_update_preview_tab(Node *p_tab_control) {
	if (!Object::cast_to<SceneThemeEditorPreview>(p_tab_control)) {
		return;
	}
	int tab_index = p_tab_control->get_index();
	SceneThemeEditorPreview *scene_preview = Object::cast_to<SceneThemeEditorPreview>(p_tab_control);
	preview_tabs->set_tab_title(tab_index, scene_preview->get_preview_scene_path().get_file());
}
void ThemeEditor::_preview_control_picked(String p_class_name) {
	theme_type_editor->select_type(p_class_name);
}
void ThemeEditor::_notification(int p_what) {
	switch (p_what) {
		case NOTIFICATION_ENTER_TREE:
		case NOTIFICATION_THEME_CHANGED: {
			preview_tabs->add_theme_style_override("tab_selected", get_theme_stylebox(SNAME("ThemeEditorPreviewFG"), SNAME("EditorStyles")));
			preview_tabs->add_theme_style_override("tab_unselected", get_theme_stylebox(SNAME("ThemeEditorPreviewBG"), SNAME("EditorStyles")));
			preview_tabs_content->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TabContainerOdd")));
			add_preview_button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
		} break;
	}
}
ThemeEditor::ThemeEditor() {