### 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 separation = Math::round(2 * EDSCALE);
				int margin_start = section_indent + separation;
				int margin_end = separation;
				
				Ref<Texture2D> arrow = _get_arrow();
				if (arrow.is_valid()) {
					Point2 arrow_position;
					if (rtl) {
						arrow_position.x = get_size().width - (margin_start + arrow->get_width());
					} else {
						arrow_position.x = margin_start;
					}
					arrow_position.y = (header_height - arrow->get_height()) / 2;
					draw_texture(arrow, arrow_position);
					margin_start += arrow->get_width();
				}
				int available = get_size().width - (margin_start + margin_end);
				
				String num_revertable_str;
				int num_revertable_width = 0;
				bool folded = foldable && !object->editor_is_section_unfolded(section);
				Ref<Font> font = get_theme_font(SNAME("bold"), SNAME("EditorFonts"));
				int font_size = get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts"));
				Color font_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
				if (folded && revertable_properties.size()) {
					int label_width = font->get_string_size(label, HORIZONTAL_ALIGNMENT_LEFT, available, font_size, TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_CONSTRAIN_ELLIPSIS).x;
					Ref<Font> light_font = get_theme_font(SNAME("main"), SNAME("EditorFonts"));
					int light_font_size = get_theme_font_size(SNAME("main_size"), SNAME("EditorFonts"));
					Color light_font_color = get_theme_color(SNAME("disabled_font_color"), SNAME("Editor"));