As someone who also suffered anxiety issues during my initial training which culminated in me loosing my medial, your post resinated hard with me. Thankfully I was able to regain my medical after an assessment at Gatwick and have gone on to have a successful career in aviation.
All I can say is, don't give up and if you wanted to chat more about it, please ping me a DM.
Cheers
Matt Dearden