### 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 (setters_map.has(p_setter)) {
			return setters_map[p_setter];
		}
		int pos = setters_map.size();
		setters_map[p_setter] = pos;
		return pos;
	}
	int get_getter_pos(const Variant::ValidatedGetter p_getter) {
		if (getters_map.has(p_getter)) {
			return getters_map[p_getter];
		}
		int pos = getters_map.size();
		getters_map[p_getter] = pos;
		return pos;
	}
	int get_keyed_setter_pos(const Variant::ValidatedKeyedSetter p_keyed_setter) {
		if (keyed_setters_map.has(p_keyed_setter)) {
			return keyed_setters_map[p_keyed_setter];
		}
		int pos = keyed_setters_map.size();
		keyed_setters_map[p_keyed_setter] = pos;
		return pos;
	}
	int get_keyed_getter_pos(const Variant::ValidatedKeyedGetter p_keyed_getter) {