### Godot version

4.0beta14

### System information

Windows 10

### Issue description

Returned Array value isn't converted to Packed*Array

### Steps to reproduce

```
var string_array: PackedStringArray = ["test"] # valid
var int_array: PackedInt32Array = [3] # valid

func get_packed_string_array() -> PackedStringArray:
	return ["test"] #error


func get_packed_int_array() -> PackedInt32Array:
	return [3] #error
```

Line 8:Cannot return value of type "Array" because the function return type is "PackedStringArray".
Line 12:Cannot return value of type "Array" because the function return type is "PackedInt32Array".

### Minimal reproduction project

[return_bug.zip](https://github.com/godotengine/godot/files/10490367/return_bug.zip)

if (p_subscript->base == nullptr) {
		return;
	}
	if (p_subscript->base->type == GDScriptParser::Node::IDENTIFIER) {
		reduce_identifier(static_cast<GDScriptParser::IdentifierNode *>(p_subscript->base), true);
	} else {
		reduce_expression(p_subscript->base);
		if (p_subscript->base->type == GDScriptParser::Node::ARRAY) {
			const_fold_array(static_cast<GDScriptParser::ArrayNode *>(p_subscript->base), false);
		} else if (p_subscript->base->type == GDScriptParser::Node::DICTIONARY) {
			const_fold_dictionary(static_cast<GDScriptParser::DictionaryNode *>(p_subscript->base), false);
		}
	}
	GDScriptParser::DataType result_type;
	if (p_subscript->is_attribute) {
		if (p_subscript->attribute == nullptr) {
			return;