After Moriarty had ordered his death for trying to leave his employ, Scanlon confronted him. However, Moriarty had planted a needle poisoned with palytoxin in the doorknob to his office, which Scanlon unintentionally triggered. He died shortly afterward.
Whether Scanlon was real was questionable, though. Holmes' assistant said the scene Arthur Conan Doyle had written about Moriarty and Scanlon's confrontation was invented. Doyle said it was implied in the notes of the case. (PROSE: Prelude All-Consuming Fire)