### Godot version

4.0.beta17

### System information

windows 10, nvidia graphics

### Issue description

When creating a typed array from another base array, if the base array was gotten from get_tree().get_nodes_in_group(), you cannot create a typed array assigning a script different from null, otherwise the resulting array will be filled with nulls.

![image](https://user-images.githubusercontent.com/5783414/216142311-1eded30c-e8ff-4a2b-aa5a-61ae5cafce13.png)


### Steps to reproduce

See attached video:

https://user-images.githubusercontent.com/5783414/216142187-82af9900-d490-4d6d-b4cc-9d776d8b8cc9.mp4



### Minimal reproduction project

[TypedArrayConstructorDoesntWorkWithScriptsWhenUsingGetNodesInGroup.zip](https://github.com/godotengine/godot/files/10560863/TypedArrayConstructorDoesntWorkWithScriptsWhenUsingGetNodesInGroup.zip)

### WorkAround

Instead of using the output of get_tree().get_nodes_in_group() directly, the user can join it with an empty array
```gdscript
[]+get_tree().get_nodes_in_group()
```
and it will work as expected.
return recursive_equal(p_array, 0);
}
bool Array::operator!=(const Array &p_array) const {
	return !recursive_equal(p_array, 0);
}
bool Array::recursive_equal(const Array &p_array, int recursion_count) const {
	
	if (_p == p_array._p) {
		return true;
	}
	const Vector<Variant> &a1 = _p->array;
	const Vector<Variant> &a2 = p_array._p->array;
	const int size = a1.size();
	if (size != a2.size()) {
		return false;
	}
	
	if (recursion_count > MAX_RECURSION) {
		ERR_PRINT("Max recursion reached");
		return true;
	}
	recursion_count++;
	for (int i = 0; i < size; i++) {
		if (!a1[i].hash_compare(a2[i], recursion_count)) {
			return false;
		}
	}
	return true;
}
bool Array::operator<(const Array &p_array) const {