Thanks for this, Christian. I've logged a Saxon bug against it:

https://saxonica.plan.io/issues/1907

and have added a test case to the QT3 test suite.

Michael Kay
Saxonica