Things like this are why I have a love/hate relationship with Lua.
You might want to add validation checks for your function arguments and throw errors when something goes wrong. You'll want your host application to print out the call stack on errors so you can track down where the problem occurred. Ultimately, though, you need to exercise all your code (whether at runtime or as part of a test framework) to make sure everything is sound.
(Background: I worked on several commercially-released titles that used Lua extensively and added Lua scripting to an older game as part of an unofficial patch.)