When's a good time to leave law?

PQE3 M&A lawyer here. I've always hated working long & unstable hours, the nature of work (i have 0 interest in law tbh) and the law firm culture in general. In the last 5 years I've worked in 3 different firms and still hate it. However I have to admit I'm not smart/outgoing, so im like the mediocre associate that no one notices. I dont see a future here and I dont want to work in law anymore.

I've decided to switch career to fulfil my dream, yet I'll need to study all over again. A job is also not guaranteed after studying. My friends suggest that i stay until PQE5-7 at least, so if my plan doesn't work, i can still have law as a back up plan. They said leaving at PQE3 is too early and if i want to come back after a 3-year gap, i basically have to compete with juniors (and will very likely lose).

Any suggestions on when to leave law please?