If you want to become a millionaire some day, then you're already on that path as a software developer. You can get top dollar by working for FAANG and working your way up the levels.fyi. That's probably the peak you can get by working for someone else.
If you want to make it to become a billionaire, then the only way is to not work for someone else, to become the boss (owner). Which means, taking a huge risk in starting your own company and working until it becomes big. You can try to become huge quickly, as a startup unicorn (which then will take many tries till you succeed) or go for a more traditional business and continuously build it over a long period of time.
If you want to go somewhere in the middle and make tens of millions, maybe hundreds, then you can switch from the software developer track to the CEO track (note that i didn't say middle-manager track). In that case, you essentially prove that you can basically be a mini-CEO, but within the confines of a very large company, by heading up a department. Then you keep on doing this with larger and larger departments, until at the end you're the CEO of the company. And then from there you leap frog from company to company, being CEO of larger and larger companies. Of course, it's often very difficult to get to those chances within a company, so succeeding as the CEO of a startup and then getting acquired (and becoming the mini-CEO of your newly formed department) is kind a way to jump onto that track from the outside.
Or, you could try switching tracks and going into finance. There, starting as an employee, there's a more clear path to make your way up the chain to partner. And since your salary is more along the lines of a percentage of revenue, as opposed to a flat salary, there's an order of magnitude more potential than as an engineer employee.