Repository: godot
Issue: Loading scenes on different clients causes godot to regenerate unique resource names for unique script resources
Labels: topic:editor,needs testing

### Godot version

Godot_v4.1.1-stable_mono_win64

### System information

Windows 10 / Windows 11 / NixOS Linux - Compatibility - Dedicated

### Issue description

Sometimes I will open Godot and return to my git prompt to discover that I now have unstaged changes, despite having done nothing in the editor. These are always unecessary and seemingly random changes to unique resource names. This causes *constant* merge conflicts, as there are minor differences in nearly every branch of my repository. Here is one of these unexpected changes:

```diff
-[sub_resource type="Resource" id="Resource_d4ct1"]
+[sub_resource type="Resource" id="Resource_o58o5"]
 resource_local_to_scene = true
 script = ExtResource("4_k7t7l")

-[sub_resource type="Resource" id="Resource_cdjla"]
+[sub_resource type="Resource" id="Resource_tq3th"]
 resource_local_to_scene = true
 script = ExtResource("5_ls05d")

-[sub_resource type="Resource" id="Resource_47c0p"]
+[sub_resource type="Resource" id="Resource_3ysnu"]
 resource_local_to_scene = true
 script = ExtResource("6_8nr7o")

-[sub_resource type="RectangleShape2D" id="RectangleShape2D_pwy1a"]
+[sub_resource type="RectangleShape2D" id="RectangleShape2D_igqer"]
 resource_local_to_scene = true
 size = Vector2(819, 776.5)

-[sub_resource type="RectangleShape2D" id="RectangleShape2D_81ade"]
+[sub_resource type="RectangleShape2D" id="RectangleShape2D_2sp71"]
 resource_local_to_scene = true
 size = Vector2(819, 776.5)

@@ -77,9 +77,9 @@ inactive_update_mode = 0

 [node name="PlayerWiper" parent="PlayerThings" instance=ExtResource("2_f2tky")]
 position = Vector2(-170, -449)
-swordAnimator = SubResource("Resource_d4ct1")
-swordStateMachine = SubResource("Resource_cdjla")
-enemyHitTracker = SubResource("Resource_47c0p")
+swordAnimator = SubResource("Resource_o58o5")
+swordStateMachine = SubResource("Resource_tq3th")
+enemyHitTracker = SubResource("Resource_3ysnu")

 [node name="Environment" type="Node" parent="."]
```

### Steps to reproduce

I like to make my scripts inherit from Resource in order to allow them to easily slot in to other scripts. This does result in a lot of unique resources in my scenes, though, because I don't often want to save the script resource to a file.

I *think* this is related to the issue, although it may be true for all resources.
I am also not certain if it is exclusive to C#. That's how I've experienced the issue, but the project I've provided below is only GDScript. Will comment with updates as I try more combinations of factors.

It also may have something to do with having multiple hosts working on the project, and maybe further that they are on different OSes.

My team is working all using 4.1.1.I use two linux hosts (occasionally dual booting into windows, which means three) and the others are using windows hosts.

The problem feels as though it occurs randomly. I am not certain that a reproduction on my machines will work for others, but I'm going to make sure it works at least between my linux and windows partition on one computer.

To reproduce, just download the project below. Init a git repo to easily track changes. Open it in Godot and run `levels/proof_of_concept/proof_of_concept.tscn`. Close godot and check if `proof_of_concept.tscn` has been modified.

### Minimal reproduction project

https://github.com/the-argus/godot-unique-resources-issue.git

NOTE: I may make changes to this repo (maybe change it to be C#) if I find that it doesn't properly reproduce the issue, in which case I'll comment on this issue tracker.