As a counterpoint, I know someone who went back to academia after getting disillusioned with tech (academia > tech > academia). The key difference may be that they live in Europe, have no student loans and the pay disparity between a developer in bioscience and in tech is not as large as I imagine it is in the US. They are paid significantly more than the scientists they work alongside but not much less than they were paid in a good tech job. For them the bioscience work is much more interesting than anything they did in tech (they have a maths-based PhD, so were working on quite complex problems but in a relatively boring field).
Software development is important to more and more industries and the pay disparity caused by insanely large funding and little requirement to produce profits means that other sectors are being priced out of in-house development, especially niche use cases. The ongoing rise of no-code development will be increasingly useful across all sectors but will fail to deliver a lot of these niche applications.
I did this as well, but started my own company. The key for a lot of people making the switch is to make the money in your first endeavor - in tech - then transition into a lower-paying but more pleasing industry, with the money buffer you built up making it possible. I've seen it a few times lately.
A lot of the smarter people I know have been recruited into Europe. People say "the salaries are so much lower lol", but the reality is, you often have employment laws that remove terrible occurrences as possibilities that are commonplace in America, you have access to healthcare, being a home owner is actually possible and if you don't want that renting is better overall. European culture is usually way less cut throat, and managers typically know their stuff, rather then failing upwards to half a million dollar salary's where using the word "digital" and being a brute is the main requirement.
Salary isn't everything. European engineering is a pretty different culture.
The way the us tries to prevent this is by crippling their people with student debt.
I don't have any student debt pressure, but I'm debating trying to do the same. I have a lot of friends in Denmark and no strong ties to the US. I'm about to hit my forties and it's probably now or never.
Software development is important to more and more industries and the pay disparity caused by insanely large funding and little requirement to produce profits means that other sectors are being priced out of in-house development, especially niche use cases. The ongoing rise of no-code development will be increasingly useful across all sectors but will fail to deliver a lot of these niche applications.