Repository: godot
Issue: Exported `NodePath` Arrays lose keyframe values when animated and saved
Labels: bug,topic:editor,topic:animation

### Tested versions

- Reproducible in 4.2.1 stable

### System information

Godot v4.2.1.stable - macOS 14.4.1 - GLES3 (Compatibility) - Apple M1 Max - Apple M1 Max (10 Threads)

### Issue description

When using a custom node which has an exported array of NodePaths (e.g., `@export var sortedChildren: Array[NodePath]`), adding values to the array and then attempting to alter or use those values in Animation Player keyframes, after saving the project, keyframe values for the array are lost as the array reverts to zero items in keyframes and the original node. 

This seems to successfully work intermitted after messing around a bit, but it fails frequently enough that I can't get a single series of keyframes together—at first I thought it was only the keyframes open in the inspector being zeroed out, but that doesn't seem to be the case as sometimes it clears the values for all keyframes or ones not open in the inspector. 

Here's an example:
<table>
<tr>
<td>
<img width="478" alt="Screenshot 2024-04-03 at 9 53 48 PM" src="https://github.com/godotengine/godot/assets/1505770/9582817b-c9aa-4598-8ace-8fc5ac12a9cd" alt="An example of setting up a array of node paths">
1. Settings the array of node paths
</td>
<td>
<img width="486" alt="Screenshot 2024-04-03 at 10 05 03 PM" src="https://github.com/godotengine/godot/assets/1505770/c046820c-b1b9-432b-af91-19ba45e049ff" alt="Creating a keyframe of the NodePath array">
2. Creating a keyframe of the NodePath array.
</td>
<td>
<img width="481" alt="Screenshot 2024-04-03 at 10 05 14 PM" src="https://github.com/godotengine/godot/assets/1505770/95eca667-04bb-41f2-a8f0-1cdcc80ad8db" alt="The keyframe after saving loses it's values">
3. The same keyframe after saving loses it's values
</td>
</tr>
</table>




### Steps to reproduce

This can be replicated very easily, either by using the included project or creating a sample project.

### Sample Project Structure: 
<img width="381" alt="Screenshot 2024-04-03 at 10 21 18 PM" src="https://github.com/godotengine/godot/assets/1505770/ad9ae845-5284-470d-b229-9bfaa83ebfa9" alt="Note structure for the project">

ArrayNodes2D: 
```gdscript
extends Node
class_name ArrayNodes2D 

@export var sortedChildren: Array[NodePath]
```

### Steps: 
1. Open or construct sample project using above details 
2. Select "ArrayNode2D" from the Node list
3. Increase array size to 2 and add Node 1 and Node 2 as items to the array
<img width="609" alt="Screenshot 2024-04-03 at 10 27 42 PM" src="https://github.com/godotengine/godot/assets/1505770/74763264-8ff0-4dc3-a78f-2874e9dfcad4" alt="Node paths in array">

4. Open Animation Player and create a new animation (or select "Basic animation" in the sample project")
5. Add a keyframe at time 0  for the Exported Array from ArrayNode2D. Review that it has the expected value in the inspector
<img width="300" alt="Screenshot 2024-04-03 at 10 27 51 PM" src="https://github.com/godotengine/godot/assets/1505770/46e496e7-31d9-41e0-9359-f1654851a23e" alt="The keyframe for the exported array value">

6. Save the project (CMD+S) **important as things will be fine until save*
7. Select the Keyframe properties to open it in the Inspector (or if still open in the inspector from step 5, re-select the keyframe again to "refresh" the inspector)
8. Observe that values are no longer saved into the keyframe's value 
<img width="604" alt="Screenshot 2024-04-03 at 10 27 28 PM" src="https://github.com/godotengine/godot/assets/1505770/0d9b1132-314c-4137-bb82-e948bf2df89b" alt="Keyframe values lost">

9. Tap "ArrayNode2D" in the Node list
10. Observe that the previously set array has been cleared 
<img width="599" alt="Screenshot 2024-04-03 at 10 27 33 PM" src="https://github.com/godotengine/godot/assets/1505770/ac1bd28b-32de-45ac-95ef-9dd415939483" alt="Array Node values lost">


Attempting to play around with adding keyframes and changing the values from this point results in some keyframes keeping their values while others may lose them. It's pretty unpredictable.


### Minimal reproduction project (MRP)

[ExportArrayAnimationFailure.zip](https://github.com/godotengine/godot/files/14860957/ExportArrayAnimationFailure.zip)