A Canadian judge called the lawyer’s failure to check the hallucinated cases “alarming.”