### 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
}
				if (nc && (ClassDB::has_signal(nc->get_name(), identifier) || ClassDB::has_method(nc->get_name(), identifier))) {
					
					GDScriptCodeGenerator::Address temp = codegen.add_temporary(); 
					GDScriptCodeGenerator::Address self(GDScriptCodeGenerator::Address::SELF);
					gen->write_get_named(temp, identifier, self);
					return temp;
				}
			}
			
			if (GDScriptLanguage::get_singleton()->get_global_map().has(identifier)) {
				
				
				HashMap<StringName, ProjectSettings::AutoloadInfo> autoloads = ProjectSettings::get_singleton()->get_autoload_list();
				if (autoloads.has(identifier) && autoloads[identifier].is_singleton) {
					GDScriptCodeGenerator::Address global = codegen.add_temporary(_gdtype_from_datatype(in->get_datatype(), codegen.script));
					int idx = GDScriptLanguage::get_singleton()->get_global_map()[identifier];
					gen->write_store_global(global, idx);
					return global;
				} else {
					int idx = GDScriptLanguage::get_singleton()->get_global_map()[identifier];
					Variant global = GDScriptLanguage::get_singleton()->get_global_array()[idx];
					return codegen.add_constant(global);
				}
			}
			
			if (ScriptServer::is_global_class(identifier)) {
				const GDScriptParser::ClassNode *class_node = codegen.class_node;
				while (class_node->outer) {
					class_node = class_node->outer;