### Godot version

4.0.beta10

### System information

Windows 10

### Issue description

For top-level class variables, a lambda stored in a dictionary cannot reference the dictionary members.

### Steps to reproduce

Assuming `MyAutoload.gd` is an autoload class, this code that worked in beta 8, no longer works in beta 10.

```gdscript
var f = func():
	MyAutoload.MyDict._str = "New string."

var MyDict: Dictionary = {
	"_str": "",
	"fun": f
}

# Parser Error: Could not resolve member "_OtherClass".
```

Autoload is unrelated however, just wanted to demonstrate how there's an inconsistent error if this is intended behavior. The following occurs regardless of autoload. If the "MyAutoload" part is removed from the lambda, a "cyclic reference" error occurs.
```gdscript
var f = func():
	MyDict._str = "New string."

var MyDict: Dictionary = {
	"_str": "",
	"fun": f
}

# Parser Error: Could not resolve member "f": Cyclic reference
```

### Minimal reproduction project

[Issue_70592_BugProject.zip](https://github.com/godotengine/godot/files/10304077/Issue_70592_BugProject.zip)
_FORCE_INLINE_ bool is_resolving() const { return kind == RESOLVING; }
		_FORCE_INLINE_ bool has_no_type() const { return type_source == UNDETECTED; }
		_FORCE_INLINE_ bool is_variant() const { return kind == VARIANT || kind == RESOLVING || kind == UNRESOLVED; }
		_FORCE_INLINE_ bool is_hard_type() const { return type_source > INFERRED; }
		String to_string() const;
		_FORCE_INLINE_ void set_container_element_type(const DataType &p_type) {
			container_element_type = memnew(DataType(p_type));
		}
		_FORCE_INLINE_ DataType get_container_element_type() const {
			ERR_FAIL_COND_V(container_element_type == nullptr, DataType());
			return *container_element_type;
		}
		_FORCE_INLINE_ bool has_container_element_type() const {
			return container_element_type != nullptr;
		}
		_FORCE_INLINE_ void unset_container_element_type() {
			if (container_element_type) {
				memdelete(container_element_type);
			};
			container_element_type = nullptr;
		}
		bool is_typed_container_type() const;
		GDScriptParser::DataType get_typed_container_type() const;
		bool operator==(const DataType &p_other) const {