You don't know how much success/failure Thor's had over the years before he was introduced to us in his own movie. Perhaps these failures he's been having were some of the first he's EVER had. Not only that, they came one right after the other, pretty much. Yeah, maybe he should've been able to get over it sooner than he did. But maybe the end of Endgame is what finally sets him back on the right path? It's fair to say he hasn't grown the way he probably should have, but after Endgame things are finally starting to look up. He was able to once and for all help get rid of the last main issue in his recovery (Thanos), and maybe finally start that redemption arc.