B. and I have been watching this mini-series, Gracepoint, starring David Tennant of Dr. Who and Anna Gunn of Breaking Bad as a pair of detectives investigating a boy's murder in a small town on the Northern California coast (played by a small town on Vancouver Island, where the filming is cheaper). I'm glad it was only ten episodes. This meant I knew it was going to end, and there was a limit to how high they could pile the plot twists.
I'm curious if the procedures here are at all typical of contemporary murder-mystery storytelling, because I don't read much in that genre, and if it's like this, it isn't encouraging me to. But my limited experience suggests it is.
The way you spin a story like this out to ten episodes is by having suspicion fall on various plausible characters sequentially, with everyone involved turning on them savagely. Then have that character clear themselves by revealing a terrible personal secret. Added points if it's something that's long cast a hidden shadow over them but of which they are actually innocent. That is, at least by their own account. Further added points if you can get one of the detectives to confess such a secret too, even without having been a suspect.
Start wrapping the show up two or three episodes before the end by having a couple witnesses show up with useful data that, if they'd only bothered to mention it earlier - and there's no obviously compelling reason why they shouldn't have - the show would have been a lot shorter.
Have the most logical and compelling suspect in custody by the end of the penultimate episode, but hint in the previews for the finale that there's one more big twist to come. The experienced mystery reader will immediately recognize this as meaning that it's time for what was known in the era of the classic British cozies as "the butler did it": that is, the true culprit will turn out to be the most overlooked major character on whom no suspicion has yet fallen, just because nobody will suspect them - except the viewer, who's read stories like this before.
Sure enough, begin the last episode with the abrupt confession of this person, which is less plausible and generally makes less sense than any of the previous wrong theories, and so out of character that it will feel like they've switched out actors for the part. Leave as many as possible of the other evidentiary puzzles unexplained. (There's time for one last twist-within-a-twist, too, but it only makes the problem worse.) CYA by having everybody say the culprit's behavior doesn't make any sense. Have the culprit say this. Doesn't help. A promising story ends like a wet rag, because you forgot to think up the explanation before you wrote the script.