I'm pretty sure I am. I've even had a manager tell me in a 1-on-1 "not everyone has the potential to be more than a mid level". Here I am 10 years into my career and still a midlevel.
With what you've said, it makes sense to feel that way. I would encourage finding ways to think about it/express it, one that doesn't make it a character flaw.
Can you phrase it in a less absolute/intrinsic way, though? "I am a dumb dumb" isn't a solvable problem.
I encourage you not to personalize this (Using "I am"). You may not be a mediocre software engineer, but that does not equal YOU being a dumb dumb.
That's a false equivalence. I'm sure there are areas where you are not a dumb dumb.
I understand what you're attempting here, but invaliding someone's feelings, even if they aren't true, doesn't work and isn't helpful. All it does is make a person not trust their feelings (at best) instead of calibrating their feelings and understanding where they come from.
Instead, accept that they feel some way. And encourage them not to let those feelings hold them back (also, avoid "but"s those also minimize or invalidate feelings).
For example, even if someone is suicidal, psychologists are trained to listen and accept their feelings.
Then help them understand why they feel that way and if other interpretations or actions can make extreme thoughts and feelings more manageable or understandable.
Depressed/suicidal people have the most accurate grasp of reality. Self-delusion and protection from self-harm are built-in into the psyche, so it's not that their feelings are inaccurate, but that unrealistic optimism is the only way humans (and other animals) can cope with reality.