Certainly some people do well but, in the main, the finances don't really work. I've never done a serious marketing push beyond book signings at some industry events (with someone else paying for the book copies) but I'm not at all confident that incremental sales would cover significant PR/marketing activities.
What it has done in my case is a likely pretty significant enhancement to my visibility/stature professionally. Which has been very beneficial.
I did shareware for a while too back in the 90s (MS-DOS mostly). I enjoyed doing it for a time, liked interacting with my testers and other users, was part of the shareware community, etc. And made reasonable side hobby business money. But certainly not at my day job level.
Writing sits comfortably in the territory of hobbies which require neither money nor storage space to perform, so I can totally understand how someone would choose to forgo money completely in order to not have to deal with the unpleasant aspects of self-publishing. Speaking of which, I assume you've already decided against traditional publishing?
Seeking for channels to give away your work for free like open source or creative commons can make more sense. Software is another issue, by the way. I used to sell shareware for Macs for 20 years, and the problem is it can cause a lot of work if you want to support your customers after initial sales have cooled down. It can easily turn into a chore.