More common, I think, in television mysteries than in detective novels, is the technique a detective may use when the murderer has managed to commit the perfect crime, at least with regard to admissible evidence: the detective falsifying evidence in order to trick the murderer into confessing. I wonder how this was ever considered legitimate.
The fundamental problem with it is that, symbolically, the detective catching the murderer is supposed to be the triumph of truth over lies. The detective is supposed to be a christ figure. The whole problem is that the murderer has mis-used reason to throw the world into disorder. The detective is supposed to triumph over evil through superior intellect, not through inferior morality.
A good way to see the problem with this approach is to consider that the confession is entirely unnecessary. If the detective knows who the murderer is and then fabricates evidence sufficiently well, that would be enough to secure a conviction without the confession. If a conviction is justice being served, then this is sufficient for justice to be served. Would anyone think it’s a good detective story if the murderer is convicted and hanged based entirely on evidence that the detective fabricated?
In fact, if the detective is willing to fabricate evidence to get a conviction, why bother with a trial at all? Why not have the detective cut to the chase and just assassinate the murderer without bothering to fake any evidence?
Oh, wait. That’s already happened. (That said, Dexter the TV series is categorized as “crime drama” and the novels as “supernatural crime horror”, not as mystery or detective fiction.)
As I said, I think that this trope is more common in television than in novels, and I can’t really think of any golden-age mysteries that feature it. I suspect that’s because it’s a crutch—a technique for writers who have written themselves into a corner and have a deadline approaching too fast to fix the problem. That could happen, of course, with short stories, or even with serialized novels where the author didn’t plan out his novel before the first five sixths of it have been published. That’s why I don’t want to say that it never happened. Still, I can’t think of any examples.
I really wish that TV writers didn’t give into it so often.