As an engineer, there is no such clear path. Most engineers end up working for 8 years and at the end are only making 150-250k if they are competent. Even if you make it to the management/architect level, you are looking at 250-400k.
Software Engineers are sadly not compensated fairly for the massive value they add to the economy. That's the bottom line. We need to work together to change it.
Is there a similar career path for engineers in any tech company that is the equivalent of "making partner" in a law firm? Genuinely curious.
On the other hand, have you asked any newly minted lawyers about their "career path" recently?
Or is it that specialized lawyers can make $350+/hr? In which case developers with certain specialities can make that much as well.
Also, the mode compensation for a lawyer is only like 55,000. The low population, insane compensation segment drags the mean way up.
The only real solution to this problem that I can see is for each of us to be so super smart and accomplished that we have the capacity to make a significant contribution that not many others can. And then develop the social skills to demand the kind of money that we (fairly) think we deserve.
Now, regarding your proposed solution of becoming a master of rare and difficult skills. That's what I strive for, but that can be a challenge in an industry where technologies are replaced every 5 years or so. In reality it becomes that much harder because unlike other professions the mindset of employers does not respect the concept of 'superstars'. Ie. I can't really name a developer that has the ability to command a 50% premium over his peers. However, I can name several companies that can demand a price premium for their consulting services. So, how do we as a field make the shift from companies achieving a price premium to individuals achieving a salary premium?