The problem in both these cases is pd->sprite->newSprite() gets routed to the Lua sprite creation function but that code is expecting a clean stack, as if it were called from a Lua function. It's a pretty glaring bug, very surprised this hasn't come up before.
I can't think of a good workaround since we don't have direct stack manipulation functions in the C API. I think the best option until I get this fixed is to create the sprite in Lua and pass it into the C function, retrieve it there with pd->lua->getSprite(1).
I've got this filed, will fix it as soon as I get a chance. Thanks for catching it!
I'm working on a hybrid system of Lua and C_API and I keep running into this problem.
Please ensure that this is fixed, as each workaround increases the number of detours and may not be practical depending on the number of passes.