### 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?)
Animation::InterpolationType interp_mode = animation->track_get_interpolation_type(track);
					Ref<Texture2D> icon = interp_icon[interp_mode];
					interp_mode_rect.position.x = ofs;
					interp_mode_rect.position.y = int(get_size().height - icon->get_height()) / 2;
					interp_mode_rect.size = icon->get_size();
					if (!animation->track_is_compressed(track) && (animation->track_get_type(track) == Animation::TYPE_VALUE || animation->track_get_type(track) == Animation::TYPE_BLEND_SHAPE || animation->track_get_type(track) == Animation::TYPE_POSITION_3D || animation->track_get_type(track) == Animation::TYPE_SCALE_3D || animation->track_get_type(track) == Animation::TYPE_ROTATION_3D)) {
						draw_texture(icon, interp_mode_rect.position);
					}
					
					interp_mode_rect.position.y = 0;
					interp_mode_rect.size.y = get_size().height;
					ofs += icon->get_width() + hsep / 2;
					interp_mode_rect.size.x += hsep / 2;
					if (!read_only && !animation->track_is_compressed(track) && (animation->track_get_type(track) == Animation::TYPE_VALUE || animation->track_get_type(track) == Animation::TYPE_BLEND_SHAPE || animation->track_get_type(track) == Animation::TYPE_POSITION_3D || animation->track_get_type(track) == Animation::TYPE_SCALE_3D || animation->track_get_type(track) == Animation::TYPE_ROTATION_3D)) {
						draw_texture(down_icon, Vector2(ofs, int(get_size().height - down_icon->get_height()) / 2));
						interp_mode_rect.size.x += down_icon->get_width();
					} else {
						interp_mode_rect = Rect2();
					}
					ofs += down_icon->get_width();
					draw_line(Point2(ofs + hsep * 0.5, 0), Point2(ofs + hsep * 0.5, get_size().height), linecolor, Math::round(EDSCALE));
					ofs += hsep;
				}
				{
					
					bool loop_wrap = animation->track_get_interpolation_loop_wrap(track);
					Ref<Texture2D> icon = wrap_icon[loop_wrap ? 1 : 0];
					loop_wrap_rect.position.x = ofs;
					loop_wrap_rect.position.y = int(get_size().height - icon->get_height()) / 2;
					loop_wrap_rect.size = icon->get_size();