I've spent a lot of time thinking about this; certainly more energy than it deserves since I don't buy lottery tickets.
If I somehow got enough money to where I never have to work again, I think I'd still do software engineering at a company, but I think I would stop focusing on how much I'm being paid, and more importantly, I'd stop being scared all the time.
I've been "laid off" (really fired) twice in the last year (and there's still time for a third!), and it's led to a near-constant state of fear on my end. Every time my manager schedules a meeting, I'm petrified that it's gonna be outlining the details of my severance and COBRA. Every night, I'm psychotically checking my email to make sure that I didn't forget some requirement that's going to piss off an executive. I'm constantly afraid to speak my mind at my job because I'm afraid that if I say something unpopular that it will be the final straw, and I'll be stuck spamming LinkedIn again.
If I had millions upon millions of dollars to my name, I think I'd have less anxiety about everything. If I get fired, who cares? If I get a bad review and don't get a promotion I want, no big deal. The job would be there to supply me with a stream of interesting problems, not an existential requirement.
ETA:
Just to be clear, my managers at my current job are perfectly nice, they've never done anything to make me feel like I should be walking on eggshells, I'm just dealing with some trauma.