I disagree that it is easier to make 400k-500k as a medical student than a tech worker, from my personal experience as a tech worker and from the experiences of many friends and family in tech at a variety of companies (FAANG, startups, etc) and in medicine. The average medical student in terms of intelligence and ability to work hard would almost definitely make it to L6/E6 before 35 if they started out of undergrad, and it would definitely be easier/less time-consuming than matching specialties of similar compensation. Taking into consideration possible student debt and years of training in medicine, I think tech in comparison makes a lot of financial sense right now (but of course, that could change). It is pretty astonishing how lucrative it is right now, after being on the "inside" of a tech company for some time.
Besides monetary compensation, I also imagine tech work/lifestyle might be a good or better fit for a decent subset of med students. I know quite a few people who would have been competitive for medical school or were even accepted to medical school who are now very happy in their tech jobs. I think it's important that premeds are aware of these other careers as I think there is some overlap in interests, values, and personality types between medicine and tech.
That being said, I completely agree with a previous comment that there is no perfect job, and I also acknowledge tech is not for everyone. For example, there are probably a lot of medical students who would not feel personally fulfilled in the majority of tech roles.