### Godot version

v4.0.beta17.official [c40020513]

### System information

Apple M1 Max - macOS Ventura 13.1 (22C65)

### Issue description

I am getting an error due to functions no longer returning the correct typed array, when the function concatenates arrays and returns it.

In other words, the following fails:

```
func add_arrays() -> Array[ClassA]:
	var array_1: Array[ClassA] = []
	var array_2: Array[ClassA] = []
	return array_1 + array_2
```

<img width="864" alt="Screenshot 2023-02-02 at 1 02 53 PM" src="https://user-images.githubusercontent.com/905216/216320503-475bf4a1-353e-455c-87d5-69d036db706c.png">

I'm assuming when concatenating, the typing changes to a generic `Array` now? Just a guess. 

### Steps to reproduce

N/A

### Minimal reproduction project

[Godot Crash Project.zip](https://github.com/godotengine/godot/files/10568780/Godot.Crash.Project.zip)

if (subscript->base->type == GDScriptParser::Node::IDENTIFIER) {
			base_id = static_cast<GDScriptParser::IdentifierNode *>(subscript->base);
		}
		if (base_id && GDScriptParser::get_builtin_type(base_id->name) < Variant::VARIANT_MAX) {
			base_type = make_builtin_meta_type(GDScriptParser::get_builtin_type(base_id->name));
		} else {
			reduce_expression(subscript->base);
			base_type = subscript->base->get_datatype();
			is_self = subscript->base->type == GDScriptParser::Node::SELF;
		}
	} else {
		
		
		p_call->set_datatype(call_type);
		mark_node_unsafe(p_call);
		return;
	}
	int default_arg_count = 0;
	BitField<MethodFlags> method_flags;
	GDScriptParser::DataType return_type;
	List<GDScriptParser::DataType> par_types;
	bool is_constructor = (base_type.is_meta_type || (p_call->callee && p_call->callee->type == GDScriptParser::Node::IDENTIFIER)) && p_call->function_name == SNAME("new");
	if (get_function_signature(p_call, is_constructor, base_type, p_call->function_name, return_type, par_types, default_arg_count, method_flags)) {
		
		
		if (method_flags.has_flag(METHOD_FLAG_VIRTUAL)) {
			if (p_call->is_super) {
				push_error(vformat(R"*(Cannot call the parent class' virtual function "%s()" because it hasn't been defined.)*", p_call->function_name), p_call);
			} else {
				push_error(vformat(R"*(Cannot call virtual function "%s()" because it hasn't been defined.)*", p_call->function_name), p_call);