### 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.
Array result;
	result._p->typed = _p->typed;
	ERR_FAIL_COND_V_MSG(p_step == 0, result, "Slice step cannot be zero.");
	const int s = size();
	int begin = CLAMP(p_begin, -s, s);
	if (begin < 0) {
		begin += s;
	}
	int end = CLAMP(p_end, -s, s);
	if (end < 0) {
		end += s;
	}
	ERR_FAIL_COND_V_MSG(p_step > 0 && begin > end, result, "Slice is positive, but bounds is decreasing.");
	ERR_FAIL_COND_V_MSG(p_step < 0 && begin < end, result, "Slice is negative, but bounds is increasing.");
	int result_size = (end - begin) / p_step;
	result.resize(result_size);
	for (int src_idx = begin, dest_idx = 0; dest_idx < result_size; ++dest_idx) {
		result[dest_idx] = p_deep ? get(src_idx).duplicate(true) : get(src_idx);
		src_idx += p_step;
	}
	return result;
}
Array Array::filter(const Callable &p_callable) const {