Accessing global class_name scripts from within c#

Godot Version

4.7 Dev3

Question

I have a my_global.gd script with the class_name MyGlobal. I use it as an autoload with the name “g”. I can access this in gdscript using g.function_name(parameters …)

I am trying to access this gdscript global script from within c# but the code below does not work as c# does not know about MyGlobal. Is there any way to achieve this?

//does not work/compile
var g = GetNode<MyGlobal>("/root/g");

//does return a Node
var g = GetNode("/root/g");
GD.PrintRich(g.GetPropertyList()) //shows all properties of the global class

In gdscript instantiating a [GlobalClass] definded c# class works.