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

} break;
		case Theme::DATA_TYPE_FONT_SIZE: {
			ur->add_do_method(*edited_theme, "set_font_size", item_name, edited_type, -1);
			ur->add_undo_method(*edited_theme, "clear_font_size", item_name, edited_type);
		} break;
		case Theme::DATA_TYPE_ICON: {
			ur->add_do_method(*edited_theme, "set_icon", item_name, edited_type, Ref<Texture2D>());
			ur->add_undo_method(*edited_theme, "clear_icon", item_name, edited_type);
		} break;
		case Theme::DATA_TYPE_STYLEBOX: {
			Ref<StyleBox> sb;
			ur->add_do_method(*edited_theme, "set_stylebox", item_name, edited_type, sb);
			ur->add_undo_method(*edited_theme, "clear_stylebox", item_name, edited_type);
			if (is_stylebox_pinned(sb)) {
				ur->add_undo_method(this, "_unpin_leading_stylebox");
			}
		} break;
	}
	ur->commit_action();
	le->set_text("");
}
void ThemeTypeEditor::_item_add_lineedit_cbk(String p_value, int p_data_type, Control *p_control) {
	_item_add_cbk(p_data_type, p_control);
}
void ThemeTypeEditor::_item_override_cbk(int p_data_type, String p_item_name) {
	EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton();
	ur->create_action(TTR("Override Theme Item"));
	switch (p_data_type) {
		case Theme::DATA_TYPE_COLOR: {
			ur->add_do_method(*edited_theme, "set_color", p_item_name, edited_type, ThemeDB::get_singleton()->get_default_theme()->get_color(p_item_name, edited_type));