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

bool valid = true;
			Variant result = Variant::get_constant_value(base.builtin_type, name, &valid);
			if (valid) {
				p_identifier->is_constant = true;
				p_identifier->reduced_value = result;
				p_identifier->set_datatype(type_from_variant(result, p_identifier));
			} else if (base.is_hard_type()) {
				push_error(vformat(R"(Cannot find constant "%s" on type "%s".)", name, base.to_string()), p_identifier);
			}
		} else {
			switch (base.builtin_type) {
				case Variant::NIL: {
					if (base.is_hard_type()) {
						push_error(vformat(R"(Invalid get index "%s" on base Nil)", name), p_identifier);
					}
					return;
				}
				case Variant::DICTIONARY: {
					GDScriptParser::DataType dummy;
					dummy.kind = GDScriptParser::DataType::VARIANT;
					p_identifier->set_datatype(dummy);
					return;
				}
				default: {
					Callable::CallError temp;
					Variant dummy;
					Variant::construct(base.builtin_type, dummy, nullptr, 0, temp);
					List<PropertyInfo> properties;
					dummy.get_property_list(&properties);
					for (const PropertyInfo &prop : properties) {