If it returns -2146233054, you need to convert to hexa 0x80131522 and then in the documentation you can find what it means. In this case it is https://learn.microsoft.com/en-us/dotnet/api/system.typeloadexception?view=net-9.0 (TypeLoadException).
You are probably passing wrong value of:
dotnet_type.c_str()