I'm surrounded by many people (family and friends) in both medicine and software engineering. I've had friends who are/were pursing medicine consider SWE in the past. I've considered medicine before I majored in CS. I don't have the experience you're looking for, but I can provide my opinion.
There will always be a demand for professionals in the medical field (not just doctors). There is a current shortage of both doctors and nurses. That said, there as technology advances, the demand for software engineers will always be there. I personally believe that A.I is and should be used as a tool to improve efficiency and/or productivity, so I'm not concerned about it.
It seems as though salaries of Doctors are typically higher than Software Engineers, but there are Software Engineers who make comparable salaries. In addition to the extra schooling, you also need to keep in mind the cost of Medical School. If you'll be taking student loans, that is more potential lost income.
The work-life balance is definitely a harder thing to determine. Personally I'd say that generally, SWE has better WLB. However, many SWEs does not have good WLB. This is mostly dependent on the company and the team. My employer has a 'on-call' system where we rotate '12-hour shifts', including weekends. This may not be an industry norm, but it's common enough.
Depending on the company you work for as a SWE, your role, your skillset, the job security might be high or it might be low. I can't tell you what company or skill is which though. If the company is public company, business decisions are now being impacted by shareholders, which may include layoffs. It's not something you should be worried about, but it's something to keep in mind.
I know this might not be the insight you're looking for and it may even cause more confusion. Ultimately this is your decision. Recently one of my friends faced a similar situation as you are. They are a pre-med student who considered transitioning into CS for months but ended up sticking with medicine. At first, they had the same concerns; job security and money. However, their decision to stick to medicine was for the fact that they want to be able to provide care for others. This was also what I went through my freshmen year. While I wanted to be able to provide care for others, it wasn't as important to me, and I didn't want to go through the long schooling and the debt.