### 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?)
in_group = p_enable;
	queue_redraw();
}
void AnimationTrackEdit::append_to_selection(const Rect2 &p_box, bool p_deselection) {
	if (animation->track_is_compressed(track)) {
		return; 
	}
	
	int limit_start_hitbox = timeline->get_name_limit() - type_icon->get_width();
	Rect2 select_rect(limit_start_hitbox, 0, get_size().width - timeline->get_name_limit() - timeline->get_buttons_width(), get_size().height);
	select_rect = select_rect.intersection(p_box);
	
	for (int i = animation->track_get_key_count(track) - 1; i >= 0; i--) {
		Rect2 rect = const_cast<AnimationTrackEdit *>(this)->get_key_rect(i, timeline->get_zoom_scale());
		float offset = animation->track_get_key_time(track, i) - timeline->get_value();
		offset = offset * timeline->get_zoom_scale() + timeline->get_name_limit();
		rect.position.x += offset;
		if (select_rect.intersects(rect)) {
			if (p_deselection) {
				emit_signal(SNAME("deselect_key"), i);
			} else {
				emit_signal(SNAME("select_key"), i, false);
			}
		}
	}
}
void AnimationTrackEdit::_bind_methods() {