### Godot version

4.0.dev (c309de53997feff3286295fb2d71657f112a15db)

### System information

Linux, Nvidia, Vulkan

### Issue description

Editor segfaults when certain conditions are met when using the AnimationPlayer editor.

### Steps to reproduce

1. Create multiple animations, saved into a animation collection
2. Open an existing animation, then make a new empty animation
3. Change from seconds to fps, or add a new property to animate ()
4. Editor crashes

NOTE: It is slightly random and I have not found a perfect repro

### Minimal reproduction project

N/A (TBD?)
}
						}
						keys.sort();
						keymap.insert(tracks[i], keys);
					} break;
					default: {
					} break;
				}
			}
			
			HashMap<int, Vector<int>>::Iterator E = keymap.begin();
			while (E) {
				int track = E->key;
				Vector<int> keys = E->value;
				int len = keys.size() - 1;
				
				bool is_using_angle = animation->track_get_interpolation_type(track) == Animation::INTERPOLATION_LINEAR_ANGLE || animation->track_get_interpolation_type(track) == Animation::INTERPOLATION_CUBIC_ANGLE;
				
				Vector<Pair<real_t, Variant>> insert_queue_new;
				for (int i = 0; i < len; i++) {
					
					if (keys[i] + 1 == keys[i + 1]) {
						double from_t = animation->track_get_key_time(track, keys[i]);
						double to_t = animation->track_get_key_time(track, keys[i + 1]);
						Variant from_v = animation->track_get_key_value(track, keys[i]);
						Variant to_v = animation->track_get_key_value(track, keys[i + 1]);
						if (is_using_angle) {
							real_t a = from_v;
							real_t b = to_v;
							real_t to_diff = fmod(b - a, Math_TAU);