Repository: godot
Issue: Reloading a scene won't reset exported custom resource properties
Labels: bug,topic:core

### Godot version

3.4.2 and 4.0alpha1

### System information

Windows 10 x64

### Issue description

When you reset a scene (Eg.: `get_tree().reload_current_scene()` or `get_tree().change_scene(get_tree().current_scene.filename)`), even if you wait some time between unloading and reloading the scene (Eg.:, switching to an empty scene, waiting some time, then switching back to the previous scene) the properties for custom exported resources will retain the values they had right before the scene was unloaded (supposing those resource instances are embedded in the scene file, not created at runtime).

Let me describe the scenario. You have some scene, wich contains a single node with a script. This script exports a resource wich you instance in the inspector using a custom resource you created in another script. This custom resource has some property of any type (the exported type doesnt matter). If you load this scene, change the resource property, and then reload the scene, the resource property value will not be reset, it will be like it was right before the scene was reloaded.

### Steps to reproduce

1. create a new project
3. create a resource script
2. export a property of any value
3. create a new scene
3. create and attach a new node script onto the scene root node
4. export a resource property
5. in the inspector, instantiate a new instance of the previously created resource script
6. set some value for the resource instance property
7. in the node script, in the ready function: wait a frame, change the resource property value, wait a frame, reload the scene with `get_tree().reload_current_scene()` or `get_tree().change_scene(get_tree().current_scene.filename)` 
8. when the scene reloads and the ready function is called again, you may see that the initial value for the resource's property is not the one provided in the inspector, but the one set in the code prior to reloading the scene. This can be seen either by printing the value or debugging.
9. beware that if you are not using the attached project and you did not set any breakpoint, you will need to implement something to prevent an infinite loop of scene reloading.

### Minimal reproduction project
godot 3
[test.zip](https://github.com/godotengine/godot/files/7944151/test.zip)

godot 4
[ExportedEmbededResourcePropertyWontResetOnSceneReload.zip](https://github.com/godotengine/godot/files/10096836/ExportedEmbededResourcePropertyWontResetOnSceneReload.zip)

### Remarks
On godot 3 (not on 4), after reloading the scene, the newly created objects have the same instance ids they had prior to reloading the scene. Is this the expected behavior? Is godot deterministic and always produces the same ids given the same initial state upon scene loading?

It should be noted that setting resource_local_to_scene to true on the resources prevents the unwanted behavior. This should be obvious for resources saved to disk since loaded resources are cached if I'm not mistaken, so a modified object will obviously retain its value across scene reloads. But this is counter intuitive for embedded resources because, since it is embedded to the scene, the user would expect its properties to be reset when the scene is reset in the same way it happens with any other non resource export like strings, dictionaries etc.