I'm directly scraping the documentation to generate something like __stub.lua. This has way fewer errors.
I've taken a similar approach, but I'm generating Lua annotations instead of stubs: Lua type annotation file for the SDK
Still waiting for permission to share it.