I have ADHD. While it is often portrayed as "Kid cannot focus/can't sit still" for me it was more along the lines of "Kid doesn't have so much as an ounce of dopamine in her brain and will play a video game for 10 hours a day because doing literally anything is so exhausting it's better to just never stand up." As you can imagine, my grades were ~bad~ from time to time, mostly before I got medicated. There were some years I did really good, like K-G5, and then there were years like G8 where, IIRC, I got mostly Cs and Ds. I tended to excel in subjects I liked, getting A's if I tried, but if I disliked a subject, I almost always got a B at best.
If we define intelligence as the ability to process and solve problems, understand concepts, and store information, among other things as well, then it would seem, in my case, my grades were/are fairly unrelated to my intelligence. I was given a significant handicap where executive dysfunction made me not want to do anything and the exhaustion made it feel like my brain was fogged every time I tried to do homework or study, and yet I still didn't fail a class.
How many students are out there that get As because they work insanely hard and how many students are out there that get Bs when they hardly do more than show up to class? I can name a few, and their existence proves well enough that grades don't prove intelligence; they loosely prove your productivity and memory at best.