People don’t overcome their shortcomings and then never ever make them ever again for the rest of their life, though.
His mistake in this example is “seeing that his nephew will commit genocide on a scale his father never dreamed of and instinctually flicking on a lightsaber” - before immediately feeling a flood of total shame at himself in response. It’s actually a lesser mistake, considering the first time he tried to save one of his genocidal relatives he kicked the hell out of him and then cut his hand off before just barely managing to stop himself from delivering the killing blow.
Nobody solves a problem in their life once and then it stays solved forever. Even real life heroes struggle with those sorts of things. That he made that mistake (among others, including subtly succumbing to hubris and vanity) doesn’t erase his maturation as a character (especially considering the rest of the film’s characterization of Luke, and Hamill’s amazing work in bringing it depth and meaning). It complicates it, but by the end of the film’s arc, it’s enriched. Luke does something no Jedi’s ever done, not even Yoda. He only unlocks the potential and ability within himself to do that because he learns - finally - from the failures he kept incurring (as we all do) when his life continued past “happily ever after.”