Do you have a source for the claim of the average software engineer becomes a millionaire? As a software engineer I would really like for you to be correct.
I know several non-software people in boring industries that managed to accumulate $1M in their retirement accounts by the age of 50 while living a non-austere lifestyle and making less money than the average software developer. It isn't that hard to do in the US. Anyone making above average wages with decent savings discipline can do it, the financial math makes that obvious.