Ten years ago, I edited a book by psychologist (and former Ayn Rand lover) Nathaniel Branden, who is considered the "father of the self-esteem movement." And he said exactly what you said, self-esteem comes from accomplishments. Too bad the idiots who promulgated self-esteem in classrooms forgot to include that part and made it smarmy, feel-good idiocy instead.
The worst example I ever came upon was in an interview after the Los Angeles riots with a punk caught bashing innocent bystanders over the head with bricks. "Don't matter what I do, I'm a good person." Obviously that criminal was a product of feel-good self-esteem training in CA public schools. Today, there are millions of them out there, bricks in hand, waiting to demonstrate their high regard for themselves at the slightest provocation.
A BIG mistake people often make is considering a natural gift as an accomplishment, like beauty, natural brains or talents. HAS to be EARNED, with SOME effort, or it's pretty worthless.