### Godot version

v4.0.2.stable.official [7a0977ce2]

### System information

Linux Ubuntu 22.04 with Unity desktop

### Issue description

Local to Scene is convenient for Materials because when changing properties / shader parameters by code, we often want to affect a single entity, not all of them.

However, when the material is placed on a scene to be instantiated (aka "prefab", "blueprint" or "archetype" in other engines; we'll call it "model scene" below), and flagged Local to Scene, each instance has the two following behaviors:

1. Independent: They create their own embedded material instance. While it seems to follow Local to Scene's design, this means such instances will stop being updated with new changes on the original material on the model scene. In addition, the Local to Scene tooltip says that it should affect *run-time*, not edit time. Although there is a point in making some changes in edit time (namely ungreying the fields to allow user to change some instance fields in the inspector to override defaults), this seems to go too far by breaking the original resource relationship.
2. ID change: Every time the scene containing the instances is closed and reopen, the material ID will change in both the SubResource declaration and reference, polluting VCS diff.

Saving the material as an asset (Resource) instead of being embed in the model scene doesn't fix the issue.

For now, my workaround is to manually duplicate the resource to make it a unique instance at runtime, on game start (or node instantiation), as I do in other engines:

`sprite.material = sprite.material.duplicate()`

This doesn't allow overriding property instances in the inspector at edit time, but at east it avoids sharing material shader parameter updates with all instances (whether due to scene instantiation or material resource asset reuse), while avoiding the repeated ID change.

### Steps to reproduce

The best is to download the MRP and read the Git history which explains each step and shows the diff. It also has additional steps to demonstrate cases where the bug does _not_ occur. Below, I'll sum-up the core steps:

**ID change**

1. Create a scene with a sprite with a CanvasItemMaterial flagged Local to Scene
2. Create another scene where you instantiate the model scene
3. Save the new scene and commit in Git.
4. Close and reopen the scene and observe the diff

Observed diff:

![image](https://github.com/godotengine/godot/assets/1067772/728f7857-8b80-4e63-b705-d10ad95f23e9)

CanvasItemMaterial ID changes in both sub-resource declaration, and reference usage.

Since the ID change can be repeated indefinitely, you can also open the MRP and repeat step 4 as many times as you want. Note that the MRP has 2 scene model instances so you will see 2 IDs changing each time.

**Independence**

5. Change some property on the model scene material such as `particles_animation = true`
6. Save model scene, open scene with instance and save: particles_animation is not updated on the instance

**Bonus: Material as Resource**

Save material as a resource asset and try again: the bug still occurs.

### Minimal reproduction project

[v4.0.2 - Material of instance of scene with Local to Scene material keeps changing ID.zip](https://github.com/godotengine/godot/files/11686919/v4.0.2.-.Material.of.instance.of.scene.with.Local.to.Scene.material.keeps.changing.ID.zip)

#include "packed_scene.h"
#include "core/config/engine.h"
#include "core/config/project_settings.h"
#include "core/core_string_names.h"
#include "core/io/missing_resource.h"
#include "core/io/resource_loader.h"
#include "core/templates/local_vector.h"
#include "scene/2d/node_2d.h"
#include "scene/3d/node_3d.h"
#include "scene/gui/control.h"
#include "scene/main/instance_placeholder.h"
#include "scene/main/missing_node.h"
#include "scene/property_utils.h"
#define PACKED_SCENE_VERSION 3
#ifdef TOOLS_ENABLED
SceneState::InstantiationWarningNotify SceneState::instantiation_warn_notify = nullptr;
#endif
bool SceneState::can_instantiate() const {