### 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)

if (return_type->cname == name_cache.enum_Error) {
						r_output << base_indent << C_LOCAL_RET " = VariantUtils.ConvertToInt64(" C_LOCAL_VARARG_RET ");\n";
					} else {
						
						CRASH_NOW_MSG("Custom VarArg return type not implemented: " + return_type->name);
						r_output << base_indent << C_LOCAL_RET " = " C_LOCAL_VARARG_RET ";\n";
					}
				}
			}
		} else {
			
			r_output << base_indent << C_CLASS_NATIVE_FUNCS ".godotsharp_method_bind_ptrcall("
					 << CS_PARAM_METHODBIND ", " << (p_icall.is_static ? "IntPtr.Zero" : CS_PARAM_INSTANCE)
					 << ", " << (p_icall.get_arguments_count() ? C_LOCAL_PTRCALL_ARGS : "null")
					 << ", " << (!ret_void ? "&" C_LOCAL_RET ");\n" : "null);\n");
		}
		
		if (!ret_void) {
			if (return_type->c_out.is_empty()) {
				r_output << base_indent << "return " C_LOCAL_RET ";\n";
			} else {
				r_output << sformat(return_type->c_out, return_type->c_type_out, C_LOCAL_RET,
						return_type->name, String(), String(), base_indent);
			}
		}
	};
	if (p_icall.get_arguments_count()) {
		if (p_icall.is_vararg) {
			String vararg_arg = "arg" + argc_str;
			String real_argc_str = itos(p_icall.get_arguments_count() - 1);