A detective in a story is not just someone who carries around a badge or who has any real qualifications to solve a mystery, but rather an individual who is searching for the truth behind certain events. Though they could still have a badge and qualifications, it doesn’t matter. These characters are found everywhere, not just in mysteries or crime procedurals.
Everything that happens in the story affects the detective’s attempts to solve the mystery either negatively or positively. The detective being forced to take a few steps back because of an event that either destroyed information or an event that proved information untrue will make the story seem more realistic because in real life mysteries are not so easy to solve. Not only this but it makes the story more interesting.
I don’t really write true detective characters, though my main character at the moment can be counted loosely as one. She is searching for the truth but in a very passive manner until something happens that sets the mystery in motion. But the story isn’t truly mystery as there are other elements to any story.