Is there some special part of the brain that only works during cricket matches?
What you're saying makes zero sense.
Mental makeup of a person isn't as narrow as you're making it out to be. You're completely ignoring the larger picture and how much he has overcome and only looking at his death bowling. What kind of logic is that?
All you are doing is, through your tunnel vision, coming to conclusions that align with your preconceived ideas about somebody.
Like you said, Shami has always been expensive at the death. That's because he lacks the skill for death bowling. He only has an off-cutter as his variation. He doesn't have any other kind of cutters, slower balls, knuckle balls, etc. And he is not as good as Bumrah or Bhuvi with hitting those yorkers every time.
Shami's death over troubles is due to his lack of skills for that role. Not because he lacks mental toughness like you are claiming.