When a query is compiled to Java (under Saxon-SA), no code is generated to implement user-defined functions.
[Note: this sounds like a really bad bug, and in user terms it is. Internally, however, the code is all there to compile user-defined functions, but the list of functions to be compiled is being taken from the wrong place (the external static query context rather than the internal SQC). The code was clearly working and tested at some stage, and I'm not sure at what time it stopped working; it might be a side-effect of a previous patch.]
A source code fix has been produced, and will be included in any future 8.9.0.x maintenance release.