Whether compilation of a query is initiated using the s9api XQueryCompiler, or the lower-level StaticQueryContext object, it is not safe to reuse the XQueryCompiler or StaticQueryContext to compile more than one query - except possibly in the special case where the queries compiled the first time it is used are never executed after it has been reused.
I've been desk-checking the code in this area, and looking at the tests in the test suite, and I think that pending further investigation, it's probably best to recommend creating a new XQueryCompiler for each query that is compiled. The documentation states that this isn't necessary, and indeed that you can change the settings on the XQueryCompiler between one compilation and the next, and there is a lot of code whose only purpose is to make this possible, but I'm not 100% convinced that it's safe.
Applies to 9.2 and all known earlier releases.
(In particular - and this is largely for my reference - the XQueryCompiler owns a StaticQueryContext, and the StaticQueryContext owns an Executable, and the Executable is updated with information specific to an individual query, such as the required parameters and the list of available collations. I can't see how the default collation would become null, but the code does look wrong.)
A fix will be produced later; in the meantime, please avoid reusing the XQueryCompiler or StaticQueryContext.