I am a software engineer who left medical school (check my AMA in pre-DO).
The grass isn’t necessarily greener, it’s just different. I would say, on the whole, I personally made the right call. I legitimately have had 6 figure offers within 1 year of being in my career. However it definitely is not like you just “learn computer science” and then magically you are set for life.
Even in computer science you can extremely easily become funneled into a job that feels really difficult to have transferable skills. You legit have to adapt, and in some cases go back to square one and learn and entirely new set of skills (often forfeiting higher pay). Also doing this, while you are already working your 9-5. It actually shares a lot of the lifelong learning attributes, and the work outside of work, that medicine has.
Yes, there are “tons” of jobs, and lots of good work out there. But you learn very quickly that your area of expertise defines a lot about your career. You can’t just say you are a programmer and magically land any job you want. There are vast differences between different types of developers who use different frameworks, languages, program different things, etc. And once you start going down a route, it can be very difficult to change - your resume defines you.
I guess rambling aside... I would never argue the case of medicine vs computer science jobs. They are so incredibly different and offer such different things to people, the economy and world. The bigger argument is really why you stuck it out if you were miserable after like year 1. Definitely wouldn’t have hurt anything to try some programming or something during summer between MS1 and 2.
I feel you on a high level that yes, on a societal level there absolutely is a mantra of “good job” = medicine (or simply tons of schooling). And I think that is producing a ton of unhappy people in lots of different fields. I think the distinction with medicine is that it is such a commitment (financial and time) that people cannot gracefully enter and then leave. So the question is simply why didn’t you when you had the chance? I think that is the thing you need to reconcile, and then how to use the knowledge and degree that you do (will) have to achieve the lifestyle that you want.