This function will throw an error if the stack level points to a C closure, such as getstack(0).
debug.getstack retrieves values from the stack at the specified call level.
This function is useful for inspecting local variables or arguments at different layers of the stack frame. If no index is given, all values at that stack level are returned as a list.