Repository: godot
Issue: Mutable properties of `Resource` reference declared as `const` are not read correctly in 4.3 and later
Labels: bug,topic:gdscript

### Tested versions

- Reproducible in: v4.4.dev7.mono.official [46c8f8c5c], v4.3.stable.mono.official [77dcf97d8]
- Not reproducible in: v4.2.2.stable.mono.official [15073afe3]

### System information

Godot v4.3.stable.mono - Windows 10.0.22631 - GLES3 (Compatibility) - NVIDIA GeForce RTX 4080 (NVIDIA; 32.0.15.6636) - AMD Ryzen 9 7950X3D 16-Core Processor (32 Threads)

### Issue description

I have a custom resource like this:

```gdscript
class_name TestResource
extends Resource

var _value:Vector3
var value:Vector3:
	get: return _value
	
	
func update(value:Vector3):
	_value = value
```

Now I create such a resource using _Create_ > _New Resource ..._ > _TestResource_ and I name the file `my_test_resource.tres`.  Now in a script I load this resource and call the `update` function:

```gdscript
extends Node

var _test_resource:TestResource

func _ready():
	_test_resource = load("res://my_test_resource.tres")
	
func _process(delta):
         # call the update function every frame
	_test_resource.update(Vector3(Engine.get_process_frames(), 0, 0))

```
Finally in a second script, I also load this resource and try to read back the updates:

```gdscript
extends Node2D

# load as a constant
const my_resource_const:TestResource = preload("res://my_test_resource.tres")
# load the same resource as a variable
var my_resource_var:TestResource = preload("res://my_test_resource.tres")

func _process(delta: float) -> void:
	print("Const: ", my_resource_const.value, " Var: ", my_resource_var.value)
```

I would expect the print to show the same values for `my_resource_const.value` and `my_resource_var.value` because both  references point  to the exact same resource object (and they in fact do, they have the same object ID). In Godot 4.2 this works fine. 

![Image](https://github.com/user-attachments/assets/214277ec-8c8d-47b1-bc4c-0b415c461c15)

However in Godot 4.3 or later the `my_resource_const.value` always prints `(0,0,0)` while the `my_resource_var.value` prints the up-to-date value:

![Image](https://github.com/user-attachments/assets/22db5293-c467-4e3d-bfb8-cd40b515e50f)

My hypothesis is that this is caused by some kind of optimization that incorrectly caches the result of the call to the `value` property when the reference is declared as `const` ([here maybe?](https://github.com/godotengine/godot/blob/0726d3c7d5125d1a72ec318a2ec4ff11f9f7f8bb/modules/gdscript/gdscript_analyzer.cpp#L1996)). It is the same underlying object in both cases and the property value is actually changed (otherwise the reference delcared as `var` wouldn't update either).


### Steps to reproduce

Open the attached example project in Godot 4.2, open `const_vs_var.tscn` and run the scene. You should see the expected output. Now open the same project in Godot 4.3 or 4.4dev7 and run the scene again. You should see that in these version the `value` property of the variable declared as `const` does not read the updated value correctly. 

### Minimal reproduction project (MRP)

[const_vs_var.zip](https://github.com/user-attachments/files/18435803/const_vs_var.zip)