Yes, if your code does not live long enough to become legacy ... the project failed. All good code is (or will be) legacy code by definition. Most companies and projects die because nobody cares about them, not because they were difficult to maintain.
What’s the definition of “Legacy Code”? It’s code that has business value.
(otherwise you’d just delete it and move on)