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

select_items_label = select_styleboxes_label;
				deselect_all_items_button = deselect_all_styleboxes_button;
				select_all_items_button = select_all_styleboxes_button;
				select_full_items_button = select_full_styleboxes_button;
				total_selected_items_label = total_selected_styleboxes_label;
				items_title = TTR("Styleboxes");
				select_all_items_tooltip = TTR("Select all visible stylebox items.");
				select_full_items_tooltip = TTR("Select all visible stylebox items and their data.");
				deselect_all_items_tooltip = TTR("Deselect all visible stylebox items.");
				break;
			case Theme::DATA_TYPE_MAX:
				continue; 
		}
		if (i > 0) {
			import_bulk_vb->add_child(memnew(HSeparator));
		}
		HBoxContainer *all_set = memnew(HBoxContainer);
		import_bulk_vb->add_child(all_set);
		HBoxContainer *label_set = memnew(HBoxContainer);
		label_set->set_h_size_flags(Control::SIZE_EXPAND_FILL);
		all_set->add_child(label_set);
		select_items_icon->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
		label_set->add_child(select_items_icon);
		select_items_label->set_h_size_flags(Control::SIZE_EXPAND_FILL);
		select_items_label->set_clip_text(true);
		select_items_label->set_text(items_title);
		label_set->add_child(select_items_label);
		HBoxContainer *button_set = memnew(HBoxContainer);
		button_set->set_alignment(BoxContainer::ALIGNMENT_END);
		all_set->add_child(button_set);