### Godot version

4.0.beta10.mono.official

### System information

Windows 11

### Issue description

After registering a C# Script with Autoload and trying to connect to a signal using the `Signal.connect` method (`Singleton.Signal.connect(xxx)`) fails with `Invalid get index 'Signal' (on base: 'Node (Singleton.cs)'). But with `Object.connect` it works.

### Steps to reproduce

- Create a C# class script with a Signal named `Signal` (could be any other).
- Register it with Autoload with the name `Singleton` (could be any other).
- Create a GDScript script and try to connect the Singleton's signal using `Singleton.Signal.connect(xxx)`
- When running the project it fails with `Invalid get index 'Sample' (on base: 'Node (Singleton.cs)').`

### Minimal reproduction project

[example.zip](https://github.com/godotengine/godot/files/10414500/example.zip)

p_output.append(iconstant.proxy_name);
		p_output.append(" = ");
		p_output.append(itos(iconstant.value));
		p_output.append(";");
	}
	if (!global_constants.is_empty()) {
		p_output.append("\n");
	}
	p_output.append(CLOSE_BLOCK); 
	
	for (const EnumInterface &ienum : global_enums) {
		CRASH_COND(ienum.constants.is_empty());
		String enum_proxy_name = ienum.cname.operator String();
		bool enum_in_static_class = false;
		if (enum_proxy_name.find(".") > 0) {
			enum_in_static_class = true;
			String enum_class_name = enum_proxy_name.get_slicec('.', 0);
			enum_proxy_name = enum_proxy_name.get_slicec('.', 1);
			CRASH_COND(enum_class_name != "Variant"); 
			_log("Declaring global enum '%s' inside struct '%s'\n", enum_proxy_name.utf8().get_data(), enum_class_name.utf8().get_data());
			p_output.append("\npublic partial struct ");
			p_output.append(enum_class_name);
			p_output.append("\n" OPEN_BLOCK);
		}
		if (ienum.is_flags) {
			p_output.append("\n[System.Flags]");
		}
		p_output.append("\npublic enum ");
		p_output.append(enum_proxy_name);
		p_output.append(" : long");