### 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)

result.type_source = GDScriptParser::DataType::ANNOTATED_EXPLICIT;
		result.kind = GDScriptParser::DataType::BUILTIN;
		result.builtin_type = Variant::BOOL;
	} else if (left_type.is_variant() || right_type.is_variant()) {
		
		result.kind = GDScriptParser::DataType::VARIANT;
		mark_node_unsafe(p_binary_op);
	} else if (p_binary_op->variant_op < Variant::OP_MAX) {
		bool valid = false;
		result = get_operation_type(p_binary_op->variant_op, left_type, right_type, valid, p_binary_op);
		if (!valid) {
			push_error(vformat(R"(Invalid operands "%s" and "%s" for "%s" operator.)", left_type.to_string(), right_type.to_string(), Variant::get_operator_name(p_binary_op->variant_op)), p_binary_op);
		} else if (!result.is_hard_type()) {
			mark_node_unsafe(p_binary_op);
		}
	} else {
		ERR_PRINT("Parser bug: unknown binary operation.");
	}
	p_binary_op->set_datatype(result);
}
#ifdef SUGGEST_GODOT4_RENAMES
const char *get_rename_from_map(const char *map[][2], String key) {
	for (int index = 0; map[index][0]; index++) {
		if (map[index][0] == key) {
			return map[index][1];
		}
	}
	return nullptr;
}
const char *check_for_renamed_identifier(String identifier, GDScriptParser::Node::Type type) {