I think that if you have non perfect academics, then its pretty hard to get a training contract at a commercial law firm, however, you can probably get a job as a paralegal/business support and then a training contract at a local solicitors firm. Just bear in mind you wont be earning the big bucks, at least to start with.
There is a way into these city firms, although it will require some persistence and proactivity on your part, and you will need to create a niche for yourself in another career, which you can sell to the law firm about how you can transfer these skills into a career in law, and how this knowledge and these skills will make you a competent trainee.
Lets use Baker & Mckenzie as an example - A decent law firm with decent clients, in the elite tier but not the best of the best. On the legal 500 webpage, the entry on the IT & Telecoms section states;
"Baker McKenzie provides ‘considered, pragmatic guidance’ on issues related to fintech, AI, cloud computing and data; the firm also has expertise in the cybersecurity and healthtech spaces."
Now, what this is saying is that they have a degree of expertise in the above areas. If you look at it in a different way, you can see that the firm therefore needs lawyers with knowledge/experience of these areas in there TMT practices. So lets say you had a career in one of these fields, perhaps as a cloud engineer or solutions architect/software developer etc, and therefore had a lot of knowledge and first hand experience with the technology dealt with, maybe even worked at one of the client firms.
If you then decide you want to get into law, then your application will stand out compared to other candidates, particularly if you articulate yourself well and have a clear idea of the type of practice you want to qualify into. There are various schemes and supportive organisations out there designed to help those who are changing career into law aswell, and by all accounts, firms like the experience gained in other careers. If you think about it, their clients will be from different backgrounds, so its good for them to recruit from different backgrounds too.
Thats just one area, i'm sure if you wanted to go into another practice area like Capital Markets and formerly worked in compliance or the front office of an investment bank then that would be a good sell aswell.
So you could probably end up at a law firm a few years after graduating and once in a different career, as by that time you will have a professional career behind you and not just your grades to rely on. Essentially, your grades will not be the most important thing on the application.
There is a big push in law to get more people in who previously wouldnt have worked in firms, like stay at home mothers, working class students etc...so where there is a will, there is a way i'm sure.
What you would have to ask yourself afterwards is, if you are in a great career and earning decent money, would you want to join a city law firm at the bottom and then do all the hours associated with that? Especially if you can earn six figure salary in tech, and have a more flexible working environment etc....
So to summarise, just think strategically and out of the box.