There's no problem in your example, the EGC never is required to be larger than the ungrounded conductors, so #12 EGC for #12 ungrounded is always compliant.
Where you could get into trouble with NM cable is if you're supplying HVAC equipment with an MCA of 28A and an MOCP 40A, and you choose to run #8-2 NM (for the interior portion of the circuit). Did you do that because the voltage drop on #10 would be too much? Oops, that's a 250.122(B) violation, you need a #8 EGC as well, so you better use a different wiring method (sadly, per 250.119(B) you can't use #8-3 NM and relabel one of the #8s green, unless "the conditions of maintenance and supervision ensure that only qualified persons service the installation.")
Or did you do that because you always match conductor size to the OCPD size? Then you can invoke 250.122(B) Exception, no problem.
Cheers, Wayne