### 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)
String script_path;
	bool for_completion = false;
	bool panic_mode = false;
	bool can_break = false;
	bool can_continue = false;
	List<bool> multiline_stack;
	ClassNode *head = nullptr;
	Node *list = nullptr;
	List<ParserError> errors;
#ifdef DEBUG_ENABLED
	bool is_ignoring_warnings = false;
	List<GDScriptWarning> warnings;
	HashSet<GDScriptWarning::Code> ignored_warnings;
	HashSet<int> unsafe_lines;
#endif
	GDScriptTokenizer tokenizer;
	GDScriptTokenizer::Token previous;
	GDScriptTokenizer::Token current;
	ClassNode *current_class = nullptr;
	FunctionNode *current_function = nullptr;
	SuiteNode *current_suite = nullptr;
	CompletionContext completion_context;
	CompletionCall completion_call;
	List<CompletionCall> completion_call_stack;
	bool passed_cursor = false;
	bool in_lambda = false;
	bool lambda_ended = false; 
	typedef bool (GDScriptParser::*AnnotationAction)(const AnnotationNode *p_annotation, Node *p_target);
	struct AnnotationInfo {
		enum TargetKind {