Today's daily WTF is dedicated to the XSP runtime. If you ever run into this issue
then just check all referenced resources (either in your Xpages/Custom Controls or in the theme you are using) for "emptyness".
I know that behaviour from client side Javascript files that won't be found at all if nothing is in there but it was new to me for SSJS libs.
To fix that just add a comment line if you are not adding real code this time.