### Godot version

v4.0.beta.custom_build [1d14c054a]

### System information

Kubuntu 22.10

### Issue description

Regression in master (in beta 10 the following script works correctly).

### Steps to reproduce

```gdscript
@tool
extends EditorScript

func wait(time: float) -> void:
    await get_editor_interface().get_tree().create_timer(time).timeout

func _run() -> void:
    reference()
    # Error: Cannot get return value of call to "wait()" because it returns "void".
    await wait(1.0)
    print("Test")
    unreference()
```

### Minimal reproduction project

N/A
function->default_arguments.reverse();
}
void GDScriptByteCodeGenerator::write_start(GDScript *p_script, const StringName &p_function_name, bool p_static, Variant p_rpc_config, const GDScriptDataType &p_return_type) {
	function = memnew(GDScriptFunction);
	debug_stack = EngineDebugger::is_active();
	function->name = p_function_name;
	function->_script = p_script;
	function->source = p_script->get_script_path();
#ifdef DEBUG_ENABLED
	function->func_cname = (String(function->source) + " - " + String(p_function_name)).utf8();
	function->_func_cname = function->func_cname.get_data();
#endif
	function->_static = p_static;
	function->return_type = p_return_type;
	function->rpc_config = p_rpc_config;
	function->_argument_count = 0;
}
GDScriptFunction *GDScriptByteCodeGenerator::write_end() {
#ifdef DEBUG_ENABLED
	if (!used_temporaries.is_empty()) {
		ERR_PRINT("Non-zero temporary variables at end of function: " + itos(used_temporaries.size()));
	}
#endif
	append_opcode(GDScriptFunction::OPCODE_END);
	for (int i = 0; i < temporaries.size(); i++) {