Repository: godot
Issue: Godot crashes when re-arranging nodes in the list of AnimationPlayer with some timeline options active.
Labels: bug,needs testing,crash,topic:animation

### Tested versions

- v3.6.stable.official [de2f0f147] (Official latest release)
- v4.3.stable.official [77dcf97d8]
- v3.6.stable.custom_build [de2f0f147] (custom latest build from Spine - Esoteric Software)

Crash happens it these three releases, traversing major Godot revisions.

### System information

Windows 10, Godot v3.6/v4.3 stable official, Nvidia 1070.

### Issue description

Re-arranging entries in ActionPlayers is usually required to sort the list in a convenient way mostly when there is a lot of nodes involved. I use it combined with the Funnel filter (**Only show tracks from  nodes selected in the tree**) and the List filter (**Group tracks by node or display them as plain list**).

Those filters helps to have a compact view of the ActionPlayer and manage nodes selectively since I have projects sometimes with a hundred entries in ActionPlayers,

I am experiencing crashes when the re-arrangement is made to certain locations in the ActionPlayer tree.

### Steps to reproduce

For testing I have included a Minimal reproduction project below or you can follow all these steps:

- Create a 2D scene. Create four Node2D nodes under the root node (name those as 1, 2, 3 and 4).
- Create an ActionPlayer and into it a new animation.
- In the animation create a Visibility property keyframe in frame 0 for the nodes 1, 2, 3 and 4.

- Activate the Funnel and List icon filters (**Only show tracks from nodes selected in the tree** and **Group tracks by node or display them as plain list**)

- In the scene node tree select nodes 1, 2 and 4 (not 3). Then you will see only three entries in the ActionPlayer.
- In the ActionPlayer, drag the first node track right under the last track. The crash must happen.

This also occur in different ways to re-arrange tracks, not only when moving a track to the bottom location.

Thank you for your time.

### Minimal reproduction project (MRP)

[gd_scene load_steps=2 format=2]

[sub_resource type="Animation" id=1]
resource_name = "New Anim"
tracks/0/type = "value"
tracks/0/path = NodePath("1:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("2:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("3:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("4:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}

[node name="node_2d" type="Node2D"]

[node name="1" type="Node2D" parent="."]
modulate = Color( 1, 1, 1, 0 )

[node name="2" type="Node2D" parent="."]
modulate = Color( 1, 1, 1, 0 )

[node name="3" type="Node2D" parent="."]
modulate = Color( 1, 1, 1, 0 )

[node name="4" type="Node2D" parent="."]
modulate = Color( 1, 1, 1, 0 )

[node name="animation_player" type="AnimationPlayer" parent="."]
"anims/New Anim" = SubResource( 1 )