Repository: godot
Issue: Godot 4.1: Issue adding new elements to exported Array[float], they appear as zero in the editor, <null> when printed
Labels: bug,topic:editor,topic:dotnet

### Godot version

v4.1.1.stable.mono.official [bd6af8e0e]

### System information

Godot v4.1.1.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Laptop GPU (NVIDIA; 31.0.15.2656) - AMD Ryzen 7 5800H with Radeon Graphics (16 Threads)

### Issue description

**First, this works correctly in GD Script, I have only encountered this issue when using C#**

I am trying to create a custom resource containing an exported array of float values.
When I create a new resource and add an element to the array, it shows zero in the editor but if I print the array it contains null.

![image](https://github.com/godotengine/godot/assets/91944600/c7984b6d-0045-4c51-b206-9aa8912835e7)

![image](https://github.com/godotengine/godot/assets/91944600/85ef9268-4e72-4c99-9404-b7575fd579c5)

I would expect the printed array to show [0].

### Steps to reproduce

**First, this works correctly in GD Script, I have only encountered this issue when using C#**
**GD Script examples are included to highlight the expected functionality**
**C# Script examples are included to highlight the issue**

See the supplied project [ArrayFloatNull.zip](https://github.com/godotengine/godot/files/12357936/ArrayFloatNull.zip).

Project contents:

3x versions of the resource script in GDScript, gd_test1.gd, gd_test2.gd and gd_test3.gd

The only difference in these three scripts is in how the array is initialised:

In gd_test1.gd it isn't: 
```
@tool
extends Resource
class_name GDTest1

@export var test_array : Array[float] : 
	get:
		return test_array
	set(value):
		test_array = value
		print(test_array)
```

In gd_test2.gd it is initialised to [] within the array var export line:
```
@tool
extends Resource
class_name GDTest2

@export var test_array : Array[float] = []:
	get:
		return test_array
	set(value):
		test_array = value
		print(test_array)
```

In gd_test3.gd it is initialised in the _init() function.
```
@tool
extends Resource
class_name GDTest3

func _init():
	test_array = []

@export var test_array : Array[float]:
	get:
		return test_array
	set(value):
		test_array = value
		print(test_array)
```

Each of these work as expected, i.e. in the editor, create a new GDTest# resource and add an element to the array. It shows zero in the editor and zero when printed.

**THE ISSUE**

Each of these resource scripts have been recreated in C#.

```
using Godot;
using System;

[Tool]
[GlobalClass]
public partial class CSharpTest1 : Resource
{
    private Godot.Collections.Array<float> testArray;

    [Export] public Godot.Collections.Array<float> TestArray { get => testArray; set => SetTestArray(value); }

    private void SetTestArray(Godot.Collections.Array<float> value)
    {
        testArray = value;
        GD.Print(testArray);
    }
}
```

```
using Godot;
using System;

[Tool]
[GlobalClass]
public partial class CSharpTest2 : Resource
{
    private Godot.Collections.Array<float> testArray = new Godot.Collections.Array<float>();

    [Export] public Godot.Collections.Array<float> TestArray { get => testArray; set => SetTestArray(value); }

    private void SetTestArray(Godot.Collections.Array<float> value)
    {
        testArray = value;
        GD.Print(testArray);
    }
}
```

```
using Godot;
using System;

[Tool]
[GlobalClass]
public partial class CSharpTest3 : Resource
{
    public CSharpTest3()
    {
        testArray = new Godot.Collections.Array<float>();
    }

    private Godot.Collections.Array<float> testArray;

    [Export] public Godot.Collections.Array<float> TestArray { get => testArray; set => SetTestArray(value); }

    private void SetTestArray(Godot.Collections.Array<float> value)
    {
        testArray = value;
        GD.Print(testArray);
    }
}
```

The first one (CSharpTest1.cs) works initially but is easily broken:
Create the resource:
![image](https://github.com/godotengine/godot/assets/91944600/8c72a40e-9eca-4aab-890f-2062e10bac2c)

Note the (Nil) Array[float]

Expand the array:
![image](https://github.com/godotengine/godot/assets/91944600/dbee2e5d-8695-428e-ac48-caa3844a7d5d)
![image](https://github.com/godotengine/godot/assets/91944600/abb13e26-c552-42c8-8b1c-8c2393a04eab)

Note the Array[float] (size 0)
Note the []
So, expanding the array appears to trigger the array setter as [] gets printed, but "Set TestArray" does not, as it does normally when we add elements.

Next, add an element:

![image](https://github.com/godotengine/godot/assets/91944600/f9953db4-665d-41aa-b2f2-318115882bb8)
![image](https://github.com/godotengine/godot/assets/91944600/b182535b-227a-4021-9ac1-db6ab35ed154)

Excellent, zero is shown in the editor and zero gets printed, as expected. We can repeat this and get all zeroes, as expected.
![image](https://github.com/godotengine/godot/assets/91944600/f5fefaef-1591-4cd7-ac80-69e0a7dd667e)
![image](https://github.com/godotengine/godot/assets/91944600/0acb057a-ca59-4c5e-87c9-78e430f0a4d9)

This appears to work however, if we reset the array via the curly reset arrow:
![image](https://github.com/godotengine/godot/assets/91944600/68261d2b-63b7-45d3-9636-ea785616c89a)
![image](https://github.com/godotengine/godot/assets/91944600/701d1e74-e90f-4ee3-a02c-b0fad635bac9)

and then add a new element:
![image](https://github.com/godotengine/godot/assets/91944600/e7483899-68dc-48e9-8438-32b680806f0d)
![image](https://github.com/godotengine/godot/assets/91944600/a740b69e-5497-479d-b577-2ff7ae2bfa03)

Now it shows zero in the editor but null when printed.

Repeating the above but with resources based on CSharpTest2.cs and CSharpTest3.cs will always have zero in the editor but null when printed.


### Minimal reproduction project

[ArrayFloatNull.zip](https://github.com/godotengine/godot/files/12357936/ArrayFloatNull.zip)