### 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)
void print_get_node(GetNodeNode *p_get_node);
		void print_if(IfNode *p_if, bool p_is_elif = false);
		void print_identifier(IdentifierNode *p_identifier);
		void print_lambda(LambdaNode *p_lambda);
		void print_literal(LiteralNode *p_literal);
		void print_match(MatchNode *p_match);
		void print_match_branch(MatchBranchNode *p_match_branch);
		void print_match_pattern(PatternNode *p_match_pattern);
		void print_parameter(ParameterNode *p_parameter);
		void print_preload(PreloadNode *p_preload);
		void print_return(ReturnNode *p_return);
		void print_self(SelfNode *p_self);
		void print_signal(SignalNode *p_signal);
		void print_statement(Node *p_statement);
		void print_subscript(SubscriptNode *p_subscript);
		void print_suite(SuiteNode *p_suite);
		void print_ternary_op(TernaryOpNode *p_ternary_op);
		void print_type(TypeNode *p_type);
		void print_type_test(TypeTestNode *p_type_test);
		void print_unary_op(UnaryOpNode *p_unary_op);
		void print_variable(VariableNode *p_variable);
		void print_while(WhileNode *p_while);
	public:
		void print_tree(const GDScriptParser &p_parser);
	};
#endif 
	static void cleanup();
};
#endif