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

Variant value = leading_stylebox.stylebox->get(E.name);
		Variant ref_value = leading_stylebox.ref_stylebox->get(E.name);
		if (value == ref_value) {
			continue;
		}
		for (const Ref<StyleBox> &F : styleboxes) {
			Ref<StyleBox> sb = F;
			sb->set(E.name, value);
		}
	}
	leading_stylebox.ref_stylebox = leading_stylebox.stylebox->duplicate();
	
	edited_theme->_unfreeze_and_propagate_changes();
}
void ThemeTypeEditor::_type_variation_changed(const String p_value) {
	EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton();
	ur->create_action(TTR("Set Theme Type Variation"));
	if (p_value.is_empty()) {
		ur->add_do_method(*edited_theme, "clear_type_variation", edited_type);
	} else {
		ur->add_do_method(*edited_theme, "set_type_variation", edited_type, StringName(p_value));
	}
	if (edited_theme->get_type_variation_base(edited_type) == "") {
		ur->add_undo_method(*edited_theme, "clear_type_variation", edited_type);
	} else {
		ur->add_undo_method(*edited_theme, "set_type_variation", edited_type, edited_theme->get_type_variation_base(edited_type));
	}
	ur->commit_action();
}
void ThemeTypeEditor::_add_type_variation_cbk() {