### 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
int current_locals = stack_identifiers_counts.back()->get();
		stack_identifiers_counts.pop_back();
		stack_identifiers = stack_id_stack.back()->get();
		stack_id_stack.pop_back();
#ifdef DEBUG_ENABLED
		if (!used_temporaries.is_empty()) {
			ERR_PRINT("Leaving block with non-zero temporary variables: " + itos(used_temporaries.size()));
		}
#endif
		locals.resize(current_locals);
		if (debug_stack) {
			for (const KeyValue<StringName, int> &E : block_identifiers) {
				GDScriptFunction::StackDebug sd;
				sd.added = false;
				sd.identifier = E.key;
				sd.line = current_line;
				sd.pos = E.value;
				stack_debug.push_back(sd);
			}
			block_identifiers = block_identifier_stack.back()->get();
			block_identifier_stack.pop_back();
		}
	}
	int get_name_map_pos(const StringName &p_identifier) {