Use Lots of Well-Placed Clues
Striking the best balance of mysteries and reveals can be difficult at times, but the most important thing for any twist is that there needs to be proper foreshadowing. This is especially true in a mystery/detective story. You can't just have one or two clues. There need to be multiple sprinkled throughout the story, and they need to make logical sense.
Let's say you have three characters A, B, and C. One of them committed a murder but no one knows who.
Scenario 1-No clues
The detective can just tell by glancing at A that he's pretty suspicious.
Your detective is a next-level genius. He doesn't need clues. That or he's so smart he can piece together the whole mystery in a few seconds because he's that unbelievably smart (it's totally not because the author showed him the script).
You should definitely avoid this one.
Scenario 2-You gave clues but they were too vague.
You know you're being too subtle when there are only one or two pieces of information leading your audience to suspect this plot twist.
For example, in chapter 10 paragraph 8 it is briefly mentioned in passing that character A was out at midnight. The killing happened at midnight. If that's all it took to convict them that's not enough build-up.
Okay, but what if you add lots of clues all over the place? Surely that won't make it too subtle? Not necessarily. It depends on the execution. It's possible to give lots of clues but still be too subtle. Here's an example.
Character A is determined to be the murderer because of three pieces of evidence. At the crime, there were three clues left. The lamp was broken, a painting was missing, and the victim's wallet was missing. So how do we know that Character A is the murderer?
Simple. In Chapter 2 he said "What an ugly old lamp.", in chapter 5 he said "What a lovely painting.", and in Chapter 8 he said, "I wish I was rich."
See? He hates lamps and had the motive to break a lamp. He loves paintings and therefore has the motive to steal one. He also needs money, so that's a motive to steal from the victim, a tussle that could have gone horribly wrong.
But a few cursory sentences aren't enough information to convict somebody. It hints at the idea that they may be the one who did the crime, but it's not enough. You need to go a little further.
Scenario 3-Perfect Balance
You know you've crafted a good plot twist when it makes sense after you read it.
You've made a great plot twist when it's the only logical solution to the mystery.
A perfect plot twist is one that makes the second reading even sweeter than the first because all the little details make so much more sense now that you know the truth.
When Character A was first introduced, we learned that he was strapped for cash and jealous of his friend's wealth. Later we learn he is deep in gambling debt.
We also learn he was a long-time friend of the victim, but they grew apart because the victim married his childhood crush. Who is that childhood crush? Well, her self-portrait is the painting that is missing from the victim's home.
How do we know it was this man and no one else? Because he's a cook. The specific knife used was a butcher's knife that went missing from the restaurant he worked at.
Character A is also a head taller than the victim, and the tallest person who works at the restaurant. The stab wound shows the attacker stabbed downward, and that would only make sense if the attacker was taller than the victim.
All the little pieces come together to fit perfectly.
Scenario 4-The reveal is too obvious.
If you don't try to mislead the audience a bit, they'll see your twist coming from a mile away.
This is because you never put any red herrings or misdirects, or you were too obvious with your clues.
If Character A is the only one with any motive to kill the victim and the murder weapon is a butcher's knife when he's the only person that works at a restaurant, the twist is too straightforward. No one's going to be surprised.
So you need to flesh out characters B and C too. Or you need to use a couple of red herrings.
B and C also have reason to kill the victim. B is a jealous lover who made death threats in the past and even assaulted the victim before. C is a disgruntled employee in dire financial trouble.
B works at a restaurant too, a different one than A, and would have access to a butcher's knife. The detective has to check both restaurants to make certain. He finds A's restaurant has a missing knife, but B's restaurant has nothing of the sort.
Scenario 5-You panic.
Sometimes authors get worried someone will guess their plot twist beforehand, so they pull something completely out of left field to mess with audience expectations. Even if the new twist made no sense.
It's bad writing because it leaves the audience feeling cheated. What's the point of looking at clues if the author is just going to yell "Sike".
For example, every single clue in the story makes it clear that A is clearly the bad guy, but the author insists that it was B the whole time and comes up with some unclear explanation for why it was her. Even worse is introducing a completely new character at the very end and saying.
"None of them were the bad guy. It was character D the whole time. I've never spoken of or mentioned character D until this moment, but he's the bad guy."
That's my advice regarding plot twists and mysteries. Set-up and pay-off are the most important things in a story. Carefully set the clues and the stage, give your audience a few misdirects so they won't guess your twist immediately, and go with the most logical conclusion in the end.
There's nothing wrong with having the twist be obvious, as long as it makes sense. The worst thing you can do is pull a twist out of thin air and pat yourself on the back for it.