Repository: godot
Issue: Clearing custom script node path on instance or inherited scene is ignored, still uses base value on any instance at runtime
Labels: bug,topic:core

### Tested versions

- Reproducible in v4.2.2.stable.official [15073afe3]

### System information

Godot v4.2.1.stable - Ubuntu 22.04.4 LTS 22.04 - X11 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 860M (nvidia; 535.161.07) - Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz (8 Threads)

### Issue description

I'm working with a hierarchy of scenes: base.tscn > child.tscn
- base.tscn has a root node Base and a child node Node2D. The root node has a custom script base.gd that references a node, the child node
- child.tscn inherits from base.tscn (renamed root Child) and there I cleared the node reference (with 3-dots menu > Clear)
- I also created an extra instance of base.tscn where I locally cleared the node path field

![image](https://github.com/godotengine/godot/assets/1067772/0669061c-6226-4989-9cd8-9e86a566e2d1)

![image](https://github.com/godotengine/godot/assets/1067772/7820e3ec-d1de-4945-8b89-30e26914555e)

You can see the change in VCS diff:

![image](https://github.com/godotengine/godot/assets/1067772/bfffa42b-8c7b-455a-bf63-81912a4246bf)

and even rebooting Godot preserves it (but to be safe I decided *not* to save the Clear in MRP, you'll have to clear it manually on child.tscn)

However, playing will print that the reference is considered as if it was never cleared, on both the base instance and the child scene (whether played directly via F6 or as an instance as part of demo scene).

In addition, if you keep working and modifying scripts, at some point if you'll see that the Child scene suddenly reverted to the base value, although with the Revert button still visible:

![image](https://github.com/godotengine/godot/assets/1067772/e0a16bae-53a6-4b22-8642-7f9bff58e334)

Only after another modification on the child scene will it reflecting in file diff, though.

Note: assigning the node reference to *another* node will, as usual, work. Only *clearing* it doesn't. My hypothesis is that `null` is considered like `no change` instead of `override value to null`.

Note 2: I added a sprite texture field to demonstrate that this *does not* happen with resources, only node paths.

### Steps to reproduce

1. Open MRP
2. Check that Base with cleared ref at instance level has cleared node path (if needed, 3-dots menu > Clear it)
3. Open child.tscn: this one is not cleared yet (because it's apparently unreliable to save it). Clear node path now.
4. Play demo scene and check Output log

```
/root/Root/Base has node ref /root/Root/Base/Node2D
/root/Root/Base has texture ref res://icon.svg
/root/Root/Base with cleared ref at instance level has node ref /root/Root/Base with cleared ref at instance level/Node2D  <= INCORRECT
/root/Root/Base with cleared ref at instance level has texture ref NULL
/root/Root/Child has node ref /root/Root/Child/Node2D <= INCORRECT
/root/Root/Child has texture ref NULL
/root/Root/Broke ref with Make Local, NULL node has node ref NULL
/root/Root/Broke ref with Make Local, NULL node has texture ref NULL
```

Note: I provided git VCS with the MRP so you can check the diff if needed.

### Minimal reproduction project (MRP)

[v4.2.2 - Clearing inherited scene field is ignored at runtime.zip](https://github.com/user-attachments/files/15742419/v4.2.2.-.Clearing.inherited.scene.field.is.ignored.at.runtime.zip)