Right before posting I noticed that my extension is actually working correctly, and the error, although cryptic, is not stopping the communication with the native host.
I will leave this question open since it would be good to know how to debug the error.