I understand so much of what you are saying, as I was in a similar position 5 years ago. I was 22, while I was an A student during primary school, by the end of secondary school I had become average, I think now looking back I was depressed and I have always had low self esteem, my frustrations over simple stuff that I continiously got wrong (like getting lost, missing aeroplanes etc etc), nevertheless I got into a prestigious university for law. But, I struggled A LOT, I spent my days in the library as much as everyone else but I couldn’t pass or achieve higher grades, despite all the effort I put in.
I had to repeat my second year, during that third year, someone close to me thought I should get tested for ADD/ADHD and I am a classic case of ADD. What followed was therapy with a phsychologist and updates with my dr. During these 4 months (the last of the school year), my physchologist told me repeteadly to face the fact that if I failed again (I was only allowed to repeat one year in my uni, if you repeat a second, they kick you out) and the possibilty of transferring. But I am very stubborn and refused to believe in that possibility, even though deep inside it terrified me as an option.
What helped me through it, other than CBT, was a “studying” coach, I only needed him for those 4 last months of the year, I stuck to a schedule, to a plan, that I learned to readjust if needed without worrying, and I did it! I am now pursuing a master in laws in london.
To sum up, it is not stupid to try again, if medicine is your passion, pursue it, age does NOT MATTER, we are led to BELIEVE it does and that we should have done X, Y or Z at a particular age, but this is a lie. You will be much happier if you study what you know what to do. You can choose, however, to study something related with medicine, like biology or even dentistry. But trust me, do not go to study law because your parents tell you to, too many people do it and it is a waste of time. Go to the prospectus of each degree and look at the classes in each course.
If you have doubts on what to study, I encourage you to contact a second year student in your fields of interest, ask them what their day to day is, ask if they regret studying their degree and why.