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

Vector2 mpos = mb->get_position();
		if (is_layout_rtl()) {
			mpos.x = get_size().x - mpos.x;
		}
		if (!selected && selectable) {
			selected = true;
			emit_signal(SNAME("selected"), property, -1);
			queue_redraw();
		}
		if (keying_rect.has_point(mpos)) {
			accept_event();
			emit_signal(SNAME("property_keyed"), property, use_keying_next());
			if (use_keying_next()) {
				if (property == "frame_coords" && (object->is_class("Sprite2D") || object->is_class("Sprite3D"))) {
					Vector2i new_coords = object->get(property);
					new_coords.x++;
					if (new_coords.x >= int64_t(object->get("hframes"))) {
						new_coords.x = 0;
						new_coords.y++;
					}
					if (new_coords.x < int64_t(object->get("hframes")) && new_coords.y < int64_t(object->get("vframes"))) {
						call_deferred(SNAME("emit_changed"), property, new_coords, "", false);
					}
				} else {
					if (int64_t(object->get(property)) + 1 < (int64_t(object->get("hframes")) * int64_t(object->get("vframes")))) {
						call_deferred(SNAME("emit_changed"), property, object->get(property).operator int64_t() + 1, "", false);
					}
				}
				call_deferred(SNAME("update_property"));
			}