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

item_control->add_child(pin_leader_button);
				pin_leader_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_on_pin_leader_button_pressed).bind(item_editor, E.key));
			} else {
				if (ThemeDB::get_singleton()->get_default_theme()->has_stylebox(E.key, edited_type)) {
					item_editor->set_edited_resource(ThemeDB::get_singleton()->get_default_theme()->get_stylebox(E.key, edited_type));
				} else {
					item_editor->set_edited_resource(Ref<Resource>());
				}
				item_editor->set_editable(false);
			}
			item_control->add_child(item_editor);
			_add_focusable(item_editor);
			stylebox_items_list->add_child(item_control);
		}
	}
	
	if (edited_type.is_empty() || ClassDB::class_exists(edited_type)) {
		type_variation_edit->set_editable(false);
		type_variation_edit->set_text("");
		type_variation_button->hide();
		type_variation_locked->set_visible(!edited_type.is_empty());
	} else {
		type_variation_edit->set_editable(true);
		type_variation_edit->set_text(edited_theme->get_type_variation_base(edited_type));
		_add_focusable(type_variation_edit);
		type_variation_button->show();
		type_variation_locked->hide();
	}
}
void ThemeTypeEditor::_list_type_selected(int p_index) {