I assume you mean "sell it before you open source it."
If you found one willing buyer while it was still closed source, odds are there are others. Why deprive yourself of additional income? Open sourcing does happen from closed source, but usually that's long after the income stream has exhausted itself (see, e.g., https://github.com/microsoft/ms-dos).
Or before you make it. Lots of folks get paid to make open source- they are employees, contractors, and creators with patrons who pay them to create.