Nudge Your Professors
First, I'm answering the question you need answered: Nudge your professors. Writing letters of recommendation is part of your professors' jobs.
Don't misunderstand me: They're not obligated to write letters for any one particular student. But it is, in general, their job to write appropriate letters for students they think are deserving.
But they will not do this-- and will have no way of knowing you want them to do this-- until you ask. And I am sorry to say, it may take some effort on your part, because professors have a lot of other things to do, and can be easily distracted. You may need to do more than nudge them, you may need to herd them like cats.
Because Grades Aren't Everything
Now, here's the answer to the question you did ask: Grades aren't everything. I knew a kid when I was getting my undergrad who came from a wealthy family and was systematically gaming the rules to get himself a perfect transcript. He found some loophole in the system whereby he would withdraw from a class if he thought he wasn't going to get an A, and his family was willing to eat the tuition, sometimes multiple times.
That is an extreme outlying example, but I strongly suspect he would not be able to get a good letter of recommendation, even thought he looked great on paper.
Letters of recommendation cover the intangibles of a student's profile-- work ethic, character, honesty, etc. Since you, as a prospective PhD student are applying for something like a job, and are going to be asking people to make large investments of time in training you, they are interested in those intangibles
That's the way it is. Same for industry jobs and government jobs.