i haven't looked at the source yet (working on other stuff) but i'd be willing to bet that the call is failing because there is no "define_function_args" call or it is out of sync with the actual parameters of the function. check the postgres sql file.
note: define_function_args is needed by the package_instantiate_object tcl api