### 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?)
timeline->queue_redraw();
	timeline->update_values();
	bool same = true;
	if (animation.is_null()) {
		return;
	}
	if (track_edits.size() == animation->get_track_count()) {
		
		for (int i = 0; i < track_edits.size(); i++) {
			if (track_edits[i]->get_path() != animation->track_get_path(i)) {
				same = false;
				break;
			}
		}
	} else {
		same = false;
	}
	if (same) {
		_redraw_tracks();
		_redraw_groups();
	} else {
		_update_tracks();
	}
	bezier_edit->queue_redraw();
	_update_step_spinbox();
	emit_signal(SNAME("animation_step_changed"), animation->get_step());
	emit_signal(SNAME("animation_len_changed"), animation->get_length());
	animation_changing_awaiting_update = false;
}
MenuButton *AnimationTrackEditor::get_edit_menu() {