Found the bug. And it turned out to be unspeakably stupid. There's a
statement at the beginning of the UDF, where I'm looking up an
enrollment number for the current user, and it turns out I was looking
it up for the wrong environment. Hardcoded as the wrong environment.
Time to consider a new career cleaning out stables.