Luke’s story in ROTJ is not one of becoming successful in spite of his flaws. It’s overcoming those flaws, losing self doubt, and insecurity that make him successful, that make him a Jedi.
And people don’t just overcome things once and then they’re never a problem again, either. If a story has to continue, then drama must ensue. And Luke is a focal point of that drama. Nobody becomes a perfect person at age 30, no matter how fantastical the story is. There’s still a lot of learning and overcoming to be done, backsliding and correcting that has to be accounted for. Our heroes are still people, and people are inherently flawed. That they triumph over their flaws is inspiring. But triumph doesn’t erase everything. But that speaks to your next point:
To me that’s kind of the point of myths, and fantasies, that it isn’t reality. That we do not find out our hero is secretly a drunk, beats up on his loved ones, neglects his or her children, is afraid of hights, suffers from all sorts of compulsions, etc, etc. I don’t get the idea, that making the Star Wars characters more realistic automatically makes them better.
It doesn’t “automatically” make them better, but it does make them more sympathetic and more relatable IF the execution is done well. It’s not a math problem, really. There’s no simple equasion to be applied to get Luke Skywalker in the W column and keep him there forever no matter what. He’s a fictional character in a myth. Myths aren’t reality, but they reflect it, and the best storytelling, even when it’s escapist, makes sure to not just reflect the foibles of the people reading and watching those fantasies play out, but to provide them inspiration that you can take out into the world with you. If even someone like Luke is still unsure of himself despite all the things he’s done, it’s not so bad when you’re unsure of yourself. Luke is not only providing the positive example of what to do in the face of failure, he’s a preventative warning of what NOT to do. You don’t have to make the same mistakes a great person made. You’ve seen what happened when he made them, so now you don’t have to go down that path. You’ll make your OWN mistakes though, and now through the power of myth, and the escapism of fantasy, you have an example (among, hopefully, more real life examples you can measure against as well) of what you can do when you make those mistakes.
If you want to look at Star Wars as an aspirational fable, you can still do that even if one of its heroes (or most of them, if not all of them) have character flaws. It doesn’t make them “losers.” It DOES make them failures, but some of the most successful, happy, accomplished, and upstanding people this world has ever turned out were also failures. It’s what they did in the face of those repeated failures that made them role models and legends. That’s a big part of The Last Jedi’s storytelling. The biggest part, really.