Yeah, never open source your code. There are no benefits to it. I speak from experience.
1. Unless you have business connections and raised funding from people who do, open source wil not help gain any additional adoption or raise awareness of your project. This only worked in the past.
2. Hardly anybody who does happen to use your open source project will pay you. You need massive global exposure just to make a developers' standard salary... I remember for years Evan You who built VueJS was getting like $120k max in sponsorships annually (I think it was Patreon), at the peak... And VueJS was extremely popular at the time and being updated frequently... And companies got something (e.g. exposure) in exchange for the sponsorship.
3. It doesn't matter how good it is. Implementation details don't really matter. If your product is useful, some big tech company will build an inferior alternative but promote it like crazy. Nobody will even know your project exists. It doesn't matter if your product is better for many use cases; people won't know it exists so that fact is irrelevant.
4. At best, some big tech monopoly will use your open source code to train their AI to replace you in the marketplace or drive down your wages.
People like Linus, DHH, Matt Mullenweg, Solomon Hykes... Who made millions; are from a different epoch and different place too. Not happening anymore. Don't be fooled. They all had to move to Silicon Valley at some point. It's a big club and you ain't in it.
My advice is; if you can't sell it, keep your code and use for yourself and your friends/family.