That couldn't be further from the truth. You learn much more navigating a very complex code base, having to introduce changes without breaking the APIs, making decisions about scope and communicating with stakeholders who rely on that API. Evolving a big legacy code base that is generating revenue to the business and supporting the core users is a very hard software problem
Greenfield development is easy, anyone out of a bootcamp knows how to put A+B together from internet articles.. I honestly am not amused when I see CVs of people who keep just playing with cool toys and never maintaining their code, people who never worked in code bases that are 5+ years or stayed a long time in a company.. IMO as a rule, and every rule has an exception, they aren't valuable software engineers. They haven't had to support their own systems until they become legacy... they're fad driven developers.
The best thing you can do is read this book: https://www.amazon.ca/Pragmatic-Programmer-journey-mastery-A... and apply its lessons in your company, in a code base for years.
Whatever framework or technology you're chasing honestly doesn't matter. It's bound to be considered legacy at some point anyways.