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

feature_tag = name_override.substr(dot);
				name_override = name_override.substr(0, dot);
			}
		}
		
		EditorPropertyNameProcessor::Style name_style = property_name_style;
		if ((p.usage & PROPERTY_USAGE_SCRIPT_VARIABLE) && name_style == EditorPropertyNameProcessor::STYLE_LOCALIZED) {
			name_style = EditorPropertyNameProcessor::STYLE_CAPITALIZED;
		}
		const String property_label_string = EditorPropertyNameProcessor::get_singleton()->process_name(name_override, name_style) + feature_tag;
		
		int idx = path.rfind("/");
		if (idx > -1) {
			path = path.left(idx);
		} else {
			path = "";
		}
		
		if (use_filter && !filter.is_empty()) {
			const String property_path = property_prefix + (path.is_empty() ? "" : path + "/") + name_override;
			if (!_property_path_matches(property_path, filter, property_name_style)) {
				continue;
			}
		}
		
		if (category_vbox == nullptr) {
			category_vbox = memnew(VBoxContainer);
			main_vbox->add_child(category_vbox);
		}