The sentiment—"violence does, in truth, recoil upon the violent, and the schemer falls into the pit which he digs for another"—is not a direct quote from Arthur Conan Doyle but encapsulates a core theme of the Holmes canon: poetic justice.
While Irene Adler ("A Scandal in Bohemia") notably outwits Holmes, the general pattern affirms that violence and deceit are self-destructive.