### 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_icall.get_arguments_count();
			r_output << INDENT2 "int vararg_length = " << vararg_arg << ".Length;\n"
					 << INDENT2 "int total_length = " << real_argc_str << " + vararg_length;\n";
			r_output << INDENT2 "Span<godot_variant.movable> varargs_span = vararg_length <= VarArgsSpanThreshold ?\n"
					 << INDENT3 "stackalloc godot_variant.movable[VarArgsSpanThreshold] :\n"
					 << INDENT3 "new godot_variant.movable[vararg_length];\n";
			r_output << INDENT2 "Span<IntPtr> " C_LOCAL_PTRCALL_ARGS "_span = total_length <= VarArgsSpanThreshold ?\n"
					 << INDENT3 "stackalloc IntPtr[VarArgsSpanThreshold] :\n"
					 << INDENT3 "new IntPtr[total_length];\n";
			r_output << INDENT2 "fixed (godot_variant.movable* varargs = &MemoryMarshal.GetReference(varargs_span))\n"
					 << INDENT2 "fixed (IntPtr* " C_LOCAL_PTRCALL_ARGS " = "
								"&MemoryMarshal.GetReference(" C_LOCAL_PTRCALL_ARGS "_span))\n"
					 << OPEN_BLOCK_L2;
			r_output << c_in_statements.as_string();
			r_output << INDENT3 "for (int i = 0; i < vararg_length; i++) " OPEN_BLOCK
					 << INDENT4 "varargs[i] = " << vararg_arg << "[i].NativeVar;\n"
					 << INDENT4 C_LOCAL_PTRCALL_ARGS "[" << real_argc_str << " + i] = new IntPtr(&varargs[i]);\n"
					 << CLOSE_BLOCK_L3;
			generate_call_and_return_stmts(INDENT3);
			r_output << CLOSE_BLOCK_L2;
		} else {
			r_output << c_in_statements.as_string();
			r_output << INDENT2 "void** " C_LOCAL_PTRCALL_ARGS " = stackalloc void*["
					 << argc_str << "] { " << c_args_var_content.as_string() << " };\n";
			generate_call_and_return_stmts(INDENT2);
		}
	} else {
		generate_call_and_return_stmts(INDENT2);
	}
	r_output << CLOSE_BLOCK_L1;