Repository: godot
Issue: Resource.local_to_scene in an array or dictionary does not work for child nodes that have been instantiated in PackedScene or at runtime
Labels: topic:core,needs testing

### Tested versions

v4.3.stable.official [77dcf97d8]

### System information

Godot v4.3.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated AMD Radeon RX 7900 GRE (Advanced Micro Devices, Inc.; 32.0.11037.4004) - AMD Ryzen 7 7800X3D 8-Core Processor (16 Threads)

### Issue description

Although #71578 #87268 fixes some similar issues, I'm still experiencing other issues.

1. The resources on the parent node are independent and as expected, whether stored in a variable or in an array or dictionary, whether they have been instantiated in the packedscene or at runtime.

2. The resources on the child nodes stored in a variable are independent, while stored in array or dictionary are not independent, whether they have been instantiated in the packedscene or at runtime.

3. Also during testing, I found that in addition to the second issue, the get_local_scene method of a resource that has been instantiated in packedscene points to the node that was instantiated at runtime, and which confused me.

<details><summary>Output</summary>
<p>

```
Godot Engine v4.3.stable.official.77dcf97d8 - https://godotengine.org
Vulkan 1.3.287 - Forward+ - Using Device #0: AMD - AMD Radeon RX 7900 GRE

Comparison of parent nodes already in the packedscene
Node:<Node#28806481158>	-9223372008031517431
Node:<Node#28806481158>	-9223372007914076908
Node:<Node#28806481158>	-9223372007897299696
--------------------------------------------------------
Node2:<Node#28974253335>	-9223372007863745269
Node2:<Node#28974253335>	-9223372007746304758
Node2:<Node#28974253335>	-9223372007729527521


Comparison of child nodes already in the packedscene
Node:<Node#28806481158>	-9223372007964408546
InstantiatedNode2:<Node#29326574884>	-9223372007427537624
InstantiatedNode2:<Node#29326574884>	-9223372007410760407
--------------------------------------------------------
Node2:<Node#28974253335>	-9223372007796636382
InstantiatedNode2:<Node#29326574884>	-9223372007427537624
InstantiatedNode2:<Node#29326574884>	-9223372007410760407


Comparison of instantiated parent nodes
InstantiatedNode:<Node#29192357147>	-9223372007645641444
InstantiatedNode2:<Node#29326574884>	-9223372007494646493
InstantiatedNode2:<Node#29326574884>	-9223372007477869293
--------------------------------------------------------
InstantiatedNode2:<Node#29326574884>	-9223372007511423727
InstantiatedNode2:<Node#29326574884>	-9223372007494646493
InstantiatedNode2:<Node#29326574884>	-9223372007477869293


Comparison of instantiated child nodes
InstantiatedNode:<Node#29192357147>	-9223372007578532576
InstantiatedNode2:<Node#29326574884>	-9223372007427537624
InstantiatedNode2:<Node#29326574884>	-9223372007410760407
--------------------------------------------------------
InstantiatedNode2:<Node#29326574884>	-9223372007444314841
InstantiatedNode2:<Node#29326574884>	-9223372007427537624
InstantiatedNode2:<Node#29326574884>	-9223372007410760407


--- Debugging process stopped ---

``` 

</p>
</details> 


### Steps to reproduce

1. Run project (F5).
2. Observe the console output.

### Minimal reproduction project (MRP)

[resource-local-to-scene-test.zip](https://github.com/user-attachments/files/17110959/resource-local-to-scene-test.zip)