### Godot version

4.1.dev (4d5f10fc3a)

### System information

macOS 13.3.0 - Vulkan (Forward+) - integrated Apple M1 Pro - Apple M1 Pro (8 Threads)

### Issue description

When a script was attached to a node in a saved scene and this script is exporting a member typed with `Array[Node]` . Reopening the scene when the script is missing because it was deleted or moved will cause a crash






### Steps to reproduce

1. Create a scene with two nodes
2. attach a script to the root with just one exported member typed as `Array[Node]` 
3. Add both nodes to the exported member
4. Save the scene
5. close the scene 
6. Delete the script 
7. Try to open the scene again godot will crash 

### Minimal reproduction project

with the MRP you can start reproduction steps at the sixth step.
[Test.zip](https://github.com/godotengine/godot/files/11749000/Test.zip)
if (base_scene_idx >= 0) {
		Ref<PackedScene> ps = variants[base_scene_idx];
		if (ps.is_valid()) {
			return ps->get_state();
		}
	}
	return Ref<SceneState>();
}
void SceneState::update_instance_resource(String p_path, Ref<PackedScene> p_packed_scene) {
	ERR_FAIL_COND(p_packed_scene.is_null());
	for (const NodeData &nd : nodes) {
		if (nd.instance >= 0) {
			if (!(nd.instance & FLAG_INSTANCE_IS_PLACEHOLDER)) {
				int instance_id = nd.instance & FLAG_MASK;
				Ref<PackedScene> original_packed_scene = variants[instance_id];
				if (original_packed_scene.is_valid()) {
					if (original_packed_scene->get_path() == p_path) {
						variants.remove_at(instance_id);
						variants.insert(instance_id, p_packed_scene);
					}
				}
			}
		}
	}
}
int SceneState::find_node_by_path(const NodePath &p_node) const {