Repository: godot
Issue: Loss of changes on branches with multiple nested scenes (when duplicating or exporting as new scenes)
Labels: bug,topic:editor,regression

### Tested versions

-Reproducible in: Godot v4.3.dev (c9c17d6ca)

### System information

Godot v4.3.dev (c9c17d6ca) - Debian GNU/Linux trixie/sid trixie - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (nvidia) - Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (8 Threads)

### Issue description

Duplicating a branch with multiple nested (and edited) scenes results in changes to the second level of nesting being lost. This also happens when the branch is exported as a scene.


### Steps to reproduce

To illustrate what I'm saying, I'm sharing a project with several scenes (I also show some photos).

-cube.tscn: A rigid body with BOX mesh.
-Platform.tscn: A rigid body with a PLANE mesh.
-cube_on_platform.tscn: The cube (cube.tscn) is placed on the platform (Platform.tscn).
![00](https://github.com/godotengine/godot/assets/134328639/24eedaed-5dba-4dd3-8c35-0d42ba02db2d)

-scene.tscn: I use an instance of "cube_on_platform.tscn", but I rotate it and change the color of the cube. For that I recursively set the "editable children" option twice.
![01](https://github.com/godotengine/godot/assets/134328639/69034554-a1b3-416e-9fc6-c1ccdf1b140b)

-scene_2.tscn: Same as "scene.tscn" but duplicating the modified branch. In principle, the changes are applied to the duplicate. But if I save, close and reopen, it only survives the rotation but the color edition is lost (which corresponds to the second level of nesting), it back to original setting .
![02](https://github.com/godotengine/godot/assets/134328639/c4ae647b-8e23-4ea3-af0d-01711f74dbea)

-scene_3.tscn: Same as "scene_2.tscn", but after creating the duplicate I apply the "editable children" option again (since I realized that the children are closed although the changes are still visible). If I save, close and reopen, the changes now survive (unlike "scene_2.tscn").
![03](https://github.com/godotengine/godot/assets/134328639/d6c26ab5-a586-4961-a840-bd9772ae5be3)

-scene_4.tscn: Like "scene_3.tscn" but I made a second duplicate (with the same procedure). I placed the two duplicates inside a node3d (renamed "cube_on_plantform_X2")... Then I duplicated cube_on_plantform_X2. I was forced to reapply the "editable children" option within that duplicate branch. Only then if I save, close and reopen, I don't lose the changes.
![04](https://github.com/godotengine/godot/assets/134328639/1161fc41-7d61-4d39-b063-0b2014c38f7c)

-scene_5.tscn: Like "scene_4.tscn" but I exported the duplicate of "cube_on_plantform_X2" as a scene, creating the scene "cube_on_platform_x_2_EXPORTED.tscn". When I do this immediately, that branch is replaced by a node that is an instance of that scene. In that scene the color change is lost (second level of nesting).
![05](https://github.com/godotengine/godot/assets/134328639/81914e9d-3af3-4f53-9228-7cdc8d590543)

Of course, if you want you could edit "cube_on_platform_x_2_EXPORTED.tscn" to apply a color change to the cubes. But it is clear that there is a problem when doing the export, that even an already saved change is lost.

### Minimal reproduction project (MRP)

[bug_nestig.zip](https://github.com/godotengine/godot/files/14733565/bug_nestig.zip)