Can you show us a snip of the code? It sounds like the function being called has modified the variables. Unless we see some code, we can only keep guessing. ;-)
I thought about that possibility. I tried calling other functions, including functions that just print a line of text, and functions that are outside of the current package. Same result no matter what's called.