### 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.
bool use_deferred_node_path_bit = false;
		if (E.type == Variant::OBJECT && E.hint == PROPERTY_HINT_NODE_TYPE) {
			if (value.get_type() == Variant::OBJECT) {
				if (Node *n = Object::cast_to<Node>(value)) {
					value = p_node->get_path_to(n);
				}
				use_deferred_node_path_bit = true;
			}
			if (value.get_type() != Variant::NODE_PATH) {
				continue; 
			}
		} else if (E.type == Variant::OBJECT && missing_resource_properties.has(E.name)) {
			
			Ref<Resource> ures = value;
			if (ures.is_null()) {
				value = missing_resource_properties[E.name];
			}
		} else if (E.type == Variant::ARRAY && E.hint == PROPERTY_HINT_TYPE_STRING) {
			int hint_subtype_separator = E.hint_string.find(":");
			if (hint_subtype_separator >= 0) {
				String subtype_string = E.hint_string.substr(0, hint_subtype_separator);
				int slash_pos = subtype_string.find("/");
				PropertyHint subtype_hint = PropertyHint::PROPERTY_HINT_NONE;
				if (slash_pos >= 0) {
					subtype_hint = PropertyHint(subtype_string.get_slice("/", 1).to_int());
					subtype_string = subtype_string.substr(0, slash_pos);
				}
				Variant::Type subtype = Variant::Type(subtype_string.to_int());
				if (subtype == Variant::OBJECT && subtype_hint == PROPERTY_HINT_NODE_TYPE) {
					use_deferred_node_path_bit = true;