That's true.
>not everyone is lucky enough to be intellectually gifted to succeed and not all hard work pays off
That's also true.
The part about quiting programming though is a non sequitur. You don't need to have innate talent to do something, or even to do it well, you just need to get good at it.
And you can get good enough to do things without getting genius level great, or even good at the level (or with the ease) of the person with the innate talent.
Know the old adage "good enough to do some real damage" (damage meant complimentary, as in "to do stuff")? That's the spirit.
The industry needs tens of millions of programmers, for all kinds of levels, not only innate-talent-software-gurus.
I don't even know what leetcode is (I assume from this post it's some kind of education site, or a website with problems to solve to get better, like Project Euler or something).