### 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 reduce_expression(GDScriptParser::ExpressionNode *p_expression, bool p_is_root = false);
	void reduce_array(GDScriptParser::ArrayNode *p_array);
	void reduce_assignment(GDScriptParser::AssignmentNode *p_assignment);
	void reduce_await(GDScriptParser::AwaitNode *p_await);
	void reduce_binary_op(GDScriptParser::BinaryOpNode *p_binary_op);
	void reduce_call(GDScriptParser::CallNode *p_call, bool p_is_await = false, bool p_is_root = false);
	void reduce_cast(GDScriptParser::CastNode *p_cast);
	void reduce_dictionary(GDScriptParser::DictionaryNode *p_dictionary);
	void reduce_get_node(GDScriptParser::GetNodeNode *p_get_node);
	void reduce_identifier(GDScriptParser::IdentifierNode *p_identifier, bool can_be_builtin = false);
	void reduce_identifier_from_base(GDScriptParser::IdentifierNode *p_identifier, GDScriptParser::DataType *p_base = nullptr);
	void reduce_lambda(GDScriptParser::LambdaNode *p_lambda);
	void reduce_literal(GDScriptParser::LiteralNode *p_literal);
	void reduce_preload(GDScriptParser::PreloadNode *p_preload);
	void reduce_self(GDScriptParser::SelfNode *p_self);
	void reduce_subscript(GDScriptParser::SubscriptNode *p_subscript, bool p_can_be_pseudo_type = false);
	void reduce_ternary_op(GDScriptParser::TernaryOpNode *p_ternary_op, bool p_is_root = false);
	void reduce_type_test(GDScriptParser::TypeTestNode *p_type_test);
	void reduce_unary_op(GDScriptParser::UnaryOpNode *p_unary_op);
	Variant make_expression_reduced_value(GDScriptParser::ExpressionNode *p_expression, bool &is_reduced);
	Variant make_array_reduced_value(GDScriptParser::ArrayNode *p_array, bool &is_reduced);
	Variant make_dictionary_reduced_value(GDScriptParser::DictionaryNode *p_dictionary, bool &is_reduced);
	Variant make_subscript_reduced_value(GDScriptParser::SubscriptNode *p_subscript, bool &is_reduced);
	
	Array make_array_from_element_datatype(const GDScriptParser::DataType &p_element_datatype, const GDScriptParser::Node *p_source_node = nullptr);
	GDScriptParser::DataType type_from_variant(const Variant &p_value, const GDScriptParser::Node *p_source);
	static GDScriptParser::DataType type_from_metatype(const GDScriptParser::DataType &p_meta_type);
	GDScriptParser::DataType type_from_property(const PropertyInfo &p_property, bool p_is_arg = false, bool p_is_readonly = false) const;
	GDScriptParser::DataType make_global_class_meta_type(const StringName &p_class_name, const GDScriptParser::Node *p_source);
	bool get_function_signature(GDScriptParser::Node *p_source, bool p_is_constructor, GDScriptParser::DataType base_type, const StringName &p_function, GDScriptParser::DataType &r_return_type, List<GDScriptParser::DataType> &r_par_types, int &r_default_arg_count, BitField<MethodFlags> &r_method_flags, StringName *r_native_class = nullptr);