True. But you’ve just assumed a group that is willing to spend a year or more in bad gaming before calling it quits.
There is nothing wrong with learning the craft from modules.
You're assuming that lesser = bad.
That's extreme and kind of weirdly insulting to DMs who are learning. That's not how it is, it's not how it's ever been. If you get a 9/10 experience with a WotC module, you probably get a 7.5/10 with your own stuff, even starting out (not least because it's likely customized for your group and doesn't have the weird plot-holes everpresent in pregen material).
As for learning from modules, sure and I think it's helpful to have some to learn from, but that's not the same thing as solely running those modules and believing your work is so inferior it couldn't compare, which is the issue - an issue you're making worse, btw, by asserting that the difference between an official WotC module and home-written from a new DM is the difference between "good" and "bad".
As an aside, an awful lot of modules when I grew were total trash that was way worse than what I could write when I was frickin' 11-12. Yeah I'm looking at you Terrible Trouble in Tragidore, but I'm also looking at a lot of less well-known trash including like 30% of the stuff in Dungeon. And I don't even think I'm particularly good (as a young DM my main good point was a total absence of bad DM behaviour in an era when it was very common, rather than being a good adventure writer).
I've encountered a few GMs with their decades old homebrew and..... it sucks. Some folks are great at it, some folks are not. Some folks think they are great at it.
I'm talking more about adventure-writing than homebrew settings. And frankly if a dude has been able to get people to keep playing his adventures for "decades" they probably don't suck for his group. In say, 1995, I would have bought that, when opportunities both for learning what other groups were like and finding new people were extremely limited. In 2021? If you've had people playing your stuff for 20 years, say, I doubt it actually sucks.
There are exceptions, I'm sure, but I feel like they're rare.
As for "some folks think they're great at it", frankly that applies to game designers too. I have no idea how Keep on the Shadowfell got published beyond "OOOOOH SHIIII.... 4E is coming out and we need an official adventure stat!" (likewise its follow-ups). 5E has been better in this regard at least.