Maxing G3 makes no difference to the end result of higher grades.
When first introduced, I assumed that any 'leftovers' would be added to the final phase of G5, I found this out to not be the case.
As stated above, the extra few in a grade when you've unlocked the next level, is simply to get the most out of that grade if you wish to stop there. People won't always G5 a module, some are better off at G1, or G3. It depends on the ship, loadout and purpose.
When you start the next grade, you get all of the negatives off the bat, and have to work higher to get the maximum benefits.
I'd also like to note, that the upgrade system can be a bit annoying.
I regularly find that when I've unlocked the next grade and blatantly click on the newly unlocked grade (even multiple times), it won't always 'register', and will continue to roll the current grade.
As such, if you click the newly unlocked grade, click the current and then the newly unlocked again, you'll see the dials at the top confirm it by going to staggered lines.
It saves on mats later.