I enjoyed grad school for the most part, and was really into teaching. By the time I got a professor job (a visiting one, not tenure-track), I was getting anxious about the long-term job prospects and it was getting harder and harder to justify the workload (teaching, grants, advising students, etc) given the relatively poor job security and pay. I felt if I was going to switch careers, I should do it soon since it’s not going to get any easier.
By this point (~3 yrs ago) I had several physics/astro friends who had become data scientists or similar jobs in the tech industry. Some had done programs like Insight and some got jobs on their own. Everyone I talked to seemed happy with their decision to switch careers. I ended up doing Insight and getting a job quickly after and am glad I did. The variety of the work, amount of collaboration (more), and new things to learn is still keeping me interested. I was also surprised at how many opportunities there are to give talks and seminars in the industry, which helps scratch the teaching itch.