Repository: godot
Issue: Exported Dictionaries that are modified in the Inspector and also changed at runtime are not reset to their initial value in scenes that are stored in a variable and reloaded
Labels: topic:core,needs testing

### Tested versions

v4.3.stable.official [77dcf97d8]

### System information

Godot v4.3.stable - Windows 10.0.22631 - GLES3 (Compatibility) - AMD Radeon(TM) Vega 8 Graphics (Advanced Micro Devices, Inc.; 27.20.15030.5001) - AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx (8 Threads)

### Issue description

If you create level scenes and keep them in memory by creating an autoload and storing the level.tscn in a variable like so (with either preload or load - this is something that I've found dramatically increases the efficiency of loading new level scenes)
```gdscript
var level:PackedScene = preload("res://level.tscn")
```
And if you make e.g. a player scene that has stats that you might want to modify on each level in an exported Dictionary and have a level where you customize the starting value for a stat in that level by editing the Dictionary's value in the Godot Editor,
Then if that value gets changed during gameplay and the level scene is reloaded (because the player dies) then any modifications to the value in the Dictionary will NOT go back to their original value when the level restarts, they will keep any modifications that were made while the level was running.

### Steps to reproduce

Create a level scene that can be restarted
Create an autoload that stores the level scene in a variable (PackedScene)
Create a player scene with an exported Dictionary with stats
Add the player scene to the level scene
Manually set a stat in the exported dictionary of stats for the player node within the level scene
Make some mechanism that can change the player's stats while the level scene is running

Run the level scene, make a stat in the exported dictionary change, then reload the level scene

Notes:
1) If you have exported stats that are NOT in a Dictionary, then they won't have this bug, it only happens with Dictionaries.
2) It ONLY happens if you set a value in the exported Dictionary manually on the player node within the level scene, it will not happen if the Dictionary just has default values.
3) It ONLY happens if the level scene is stored in a variable. If you do not create an autoload or something to store the level PackedScene in a variable (to greatly improve the efficiency of loading a level scene) then the bug won't occur.

### Minimal reproduction project (MRP)

This minimal reproduction project has a Level scene and a Player scene, where the player has some stats stored in various ways.

The "str" stat is stored in the exported "stats" Dictionary. In this Level scene, the Player node was added and in the inspector the exported "stats[str]" was manually set to 8. This is where the bug occurs.
The "int" stat is stored in a non-exported Dictionary and does not act buggy.
The "agi" stat is stored in an exported Integer and does not act buggy.

If you start the game, the player (Godot icon) will drop down the middle of the screen to give a visual cue if you restart the level.
Press the up arrow to increase the "str" stat.
Press the left arrow to increase the "int" stat.
Press the right arrow to increase the "agi" stat.
Press the down arrow to restart the level.

If you increase the "str" stat then when you restart the level any changes in "str" that occurred while the level was running (because you pressed up) will not reset properly. The other stats will reset to their initial values when the level restarts.

[persistent_dictionary.zip](https://github.com/user-attachments/files/18392007/persistent_dictionary.zip)