How come Ron got average grades in his exams when he'd successfully managed to cast spells better?
Here is an overview of his performance-
Astronomy: A Care of Magical Creatures: E Charms: E Defense Against the Dark Arts: E Divination: P Herbology: E History of Magic: P Potions: E Transfiguration: E
His cumulative score exceeds expectations.
O is outstanding (O or A+ in the muggle world)
E is exceeds expectations (A in the muggle world)
A is acceptable. (B in the muggle world)
Ron managed to secure 7 OWLs and got all the desired subjects for the NEWT level. Sounds pretty excellent to me.
The only average grades I can see are in-
Astronomy and Ron had zero interest in the subject.
Divination. He received a poor grade because he isn't a seer. The ability is inherited and cannot be learned.
History of magic. He had no interest in it and frankly, professor Binns did nothing to make it interesting.
Harry had a similar report card, except he secured an outstanding in DADA.
No doubt, Harry was brilliant in DADA and deserved the score, but the examiner specifically asked him to produce a Patronus spell. I am not sure if Ron and Hermione were given the same chance.
The trio was considerably advanced in the subject, thanks to Dumbledore's army, and could very well produce a Patronus by the time their OWLs were held.
Even if Harry outperformed them in DADA, an E is good enough to be an Auror.
By no means, Ron was an average student. In fact, he exceeds expectations in every aspect except the humor department, where he is certainly outstanding.
He did considerably well in his exams and was super talented. The Gryffindor quidditch team won the inter-house quidditch cup, thanks to Ron's keeping abilities. Probably, if there was an inter-school chess championship, he would have won that too.