"If you are pursuing programming to become wealthy, you’d be better off pursuing a career in management" This is hopefully false for interesting companies, otherwise, just flee! If you are working for an organization that does not value senior software engineers, this organization is just crap.
There are other factors to consider though. Generally speaking in most instances, even the interesting companies, management is going to be a faster, more reliable path to wealth. My observations lead me to conclude that:
1. Most technical staff is generally considered fungible by management, even at interesting companies, so layoffs can and do tend to impact non-management harder and more frequently, and this impacts long-term earnings.
2. Even at interesting companies management is generally compensated better in terms of salary, bonuses and (as management level rises) bonuses and stock grants. This generally isn't just a few percentage points difference in the pay, either: in most places outside those high-paying hotspots managers tend to be paid wages that are much closer to SV wages than programmers will ever see, so the difference is even greater there.