A dyamic error that occurs while evaluating the arguments of doc-available() may cause the query or transformation to fail without any error message, other than "Transformation|Query failed".
doc-available() works by calling doc() and suppressing the reporting of any errors that occur during the evaluation. In Saxon 8.8, this incorrectly suppressed errors that occurred while evaluating the expression supplied as an argument to doc-available(). This problem was half-corrected in Saxon 8.9, so that such errors now throw an exception which causes the query or transformation to fail; unfortunately though, the error is reported to a temporary ErrorListener which doesn't report it to the user, so there is no indication of what caused the failure.
A fix will be placed in Subversion.