That's the thing: was it really six whole months? There's a parallel storyline going on where the Millennium Falcon is pursued by a Star Destroyer as they escape from Hoth, hide inside an asteroid for not very long, then ditch the Imperials by attaching to their hull for no more than 12-24 hours, then get sniffed out by Boba Fett on their way to Cloud City, where they are immediately captured, which prompts Luke to leave Dagobah.
How many days could that journey possibly take them? They left Hoth at the same time Luke did. I get that the Falcon is limping to Bespin with a damaged hyperdrive, but could it have really taken them six months to get there? There's no mention of that, only that it took them long enough to get there that the Empire got to Lando "just before" they did. Some people have suggested something something hyperdrives and relativistic time dilation to explain the discrepancy, but it just doesn't seem like Luke spent very long at all with Yoda.
And even if he did spend six months there, he really didn't listen to Yoda at all. The three examples we get of Luke's training are: ignoring Yoda's warning about the cave, failing to lift the X-wing because he didn't take Yoda's teaching to heart, and then ignoring Yoda's pleas not to go to confront Vader. I'm not sure it's fair to say that Luke gained a whole lot of insight and wisdom while he was there given that he wasn't a great student. And after all that, when he comes back to finish his training, Yoda says "Actually, yeah, you're a Jedi already".
I just dislike the whole "Rey is a Mary Sue" narrative. If she's a Mary Sue, then Luke qualifies too. And you know what? That's fine. The OT is great just the way it is! I'm not saying it to denigrate Luke or his journey, I just think it's unfair to put that scrutiny on Rey exclusively as a character. Rey's character wasn't undermined by her succeeding at everything, the problem with Rey is that she never had any agency in the whole trilogy. She just kind of did what she was told most of the time, which is always boring, and is something that is covered in writing 101.