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

reduce_cast(static_cast<GDScriptParser::CastNode *>(p_expression));
			break;
		case GDScriptParser::Node::DICTIONARY:
			reduce_dictionary(static_cast<GDScriptParser::DictionaryNode *>(p_expression));
			break;
		case GDScriptParser::Node::GET_NODE:
			reduce_get_node(static_cast<GDScriptParser::GetNodeNode *>(p_expression));
			break;
		case GDScriptParser::Node::IDENTIFIER:
			reduce_identifier(static_cast<GDScriptParser::IdentifierNode *>(p_expression));
			break;
		case GDScriptParser::Node::LAMBDA:
			reduce_lambda(static_cast<GDScriptParser::LambdaNode *>(p_expression));
			break;
		case GDScriptParser::Node::LITERAL:
			reduce_literal(static_cast<GDScriptParser::LiteralNode *>(p_expression));
			break;
		case GDScriptParser::Node::PRELOAD:
			reduce_preload(static_cast<GDScriptParser::PreloadNode *>(p_expression));
			break;
		case GDScriptParser::Node::SELF:
			reduce_self(static_cast<GDScriptParser::SelfNode *>(p_expression));
			break;
		case GDScriptParser::Node::SUBSCRIPT:
			reduce_subscript(static_cast<GDScriptParser::SubscriptNode *>(p_expression));
			break;
		case GDScriptParser::Node::TERNARY_OPERATOR:
			reduce_ternary_op(static_cast<GDScriptParser::TernaryOpNode *>(p_expression), p_is_root);
			break;
		case GDScriptParser::Node::UNARY_OPERATOR: