### Godot version

v4.1.beta1.official [828ec2c5d]

### System information

Godot v4.1.beta1 - Windows 10.0.23475 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.3550) - AMD Ryzen 5 5500 (12 Threads)

### Issue description

I have an exported array for a given type I created with class_name

```
extends Node3D
class_name Enemy
```

It is exported as follow

```
@export var rollable_hazards: Array[Enemy]
```

I populate it using the editor and it works fine, but sometimes it gets emptied after saving the exporting scene. Not sure if it relates with #62916 and/or #77735.

Here's a screen recording I did showing the issue

https://github.com/godotengine/godot/assets/8123916/09d5df4e-83af-4459-b46b-1c62f78c2bb5

Please let me know if you need any additional information.

### Steps to reproduce

1. Export an array from a scene script
2. Populate it with other nodes 
3. Edit the exporting script and save it

### Minimal reproduction project

If you check this branch out, commit [327d03d](https://github.com/lazaromenezes/dungeon-explorer-godot/commit/327d03da6c995ed586b8bc8764bdb051bb42bf7b) was the base for the changes I had into the screen recording.
int add_value(const Variant &p_value);
	int add_node_path(const NodePath &p_path);
	int add_node(int p_parent, int p_owner, int p_type, int p_name, int p_instance, int p_index);
	void add_node_property(int p_node, int p_name, int p_value, bool p_deferred_node_path = false);
	void add_node_group(int p_node, int p_group);
	void set_base_scene(int p_idx);
	void add_connection(int p_from, int p_to, int p_signal, int p_method, int p_flags, int p_unbinds, const Vector<int> &p_binds);
	void add_editable_instance(const NodePath &p_path);
	virtual void set_last_modified_time(uint64_t p_time) { last_modified_time = p_time; }
	uint64_t get_last_modified_time() const { return last_modified_time; }
	
	static String get_meta_pointer_property(const String &p_property);
#ifdef TOOLS_ENABLED
	static void set_instantiation_warning_notify_func(InstantiationWarningNotify p_warn_notify) { instantiation_warn_notify = p_warn_notify; }
#endif
	SceneState();
};
VARIANT_ENUM_CAST(SceneState::GenEditState)
class PackedScene : public Resource {
	GDCLASS(PackedScene, Resource);
	RES_BASE_EXTENSION("scn");
	Ref<SceneState> state;
	void _set_bundled_scene(const Dictionary &p_scene);
	Dictionary _get_bundled_scene() const;
protected:
	virtual bool editor_can_reload_from_file() override { return false; } 
	static void _bind_methods();
	virtual void reset_state() override;
public:
	enum GenEditState {