I've been working as a software developer for the past 11 years and have had numerous jobs, spending an extraordinary amount of time looking for work. I also spent most of the 15 years before that (while working as a computer repair tech) looking for work as a software developer.
In my experience, the majority of hiring managers don't care about grades. They only care about how much experience you have and if you have at least a bachelors degree. And, many times, that doesn't matter either.
What matters is how well you interview. If you perfectly answer every question they ask, have massive energy to work for them, if you boost their ego enough, if you don't contradict or disagree with them, and accept less money than others applying for the same position, you might get a job. Maybe.
So really, it doesn't matter what you know or how well you do it, it just matters if you fit their usually narrowly defined ideal of an employee. Even if you get the job, you might not be able to keep it due to the sometimes unreasonable demands. Most US states are "right to work" jurisdictions, so your employer can fire you for pretty much any or no reason at all, and they will tell you generic excuses for why they let you go so they don't have to deal with any legal ramifications for the real reason they let you go. Similarly, they will not hire you while not giving you any reason at all. They will just "ghost" you after the interview or any other pre-employment procedures you had to go through.
And none of that has anything to do with what grades you got in school.
Rather than asking for grades, you are more likely to have to take pre-employment technical tests/assessments, write code for an example project, have a separate technical interview, supply a link to a code repository (like GitHub), include a link to an online portfolio and/or take non-technical "personality" tests. All that will likely be taken into account far more than any grades you get in school.
If I were to give you any truly actionable advice, I'd say to stick with a job in law and work your way into writing software for your employer. You'll likely have fewer problems getting a job that way. You'll also gain the professional experience that's required of nearly every software development job. (Don't ask me how else to get professional experience writing software if you can't get a job writing software without already having professional experience.)
I've worked dozens of jobs as a software developer and as a computer repair tech, only to be let go for a variety of reasons that made little sense at the time, such as: economic downturn, lack of work, asking too many questions, not asking enough questions, and not fitting into the department culture. There we probably a dozen other "reasons" that had nothing to do with my work ethic (except those times when I apparently worked myself out of a job).
This includes contracts, contracts to hire, and direct hire positions.
Also, I've been looking for a new job since April. In that time, I estimate that I've read thousands of job descriptions and applied to between 600 and 900 jobs. The current job market for software developers is not good. And that goes triple for anyone with less than 5 years professional experience. Then there's the arms-length list of requirements that (even with my range of skills and experience) seems to keep anyone from getting a job who doesn't also spend +8 hours a day outside of work learning new skills that their current job will never teach them, since employers now seem to expect employees to 100% match the job description, and then some. Employers apparently don't want to teach skills anymore.
Even though employers want you to learn skills on your own and possibly work on open-source projects to demonstrate your skills, none of that really matters to a hiring manager since it's not actual work experience.
Oh, and even though managers might suggest working on an open-source project to gain more experience, you probably shouldn't get "caught" doing this while having a job (even on your own time), since your employer might take that as competing against them or leaking proprietary information. Not only could you lose your job, but you might get sued. Even if the suit is a false claim, you could still be left with massive legal debt.
In all the interviews I've had over the last +25 years, I can't remember a single manager asking me what grades I got in school, even when I was still in school. I think there might have been one manager that asked if they could query my schools for transcripts, but that was more for making sure I actually went to the school, rather than for any specific grades. I know the interviews I had for my first software development job didn't ask for grades.