14 Ga stranded wire bathroom fan/light on 20 Amp circuit?
That's perfectly fine. The device wiring is based on the device requirements and 14 (sometimes smaller!) is fine if designed tested and certified (UL) appropriately.

Code requirements are based on the total circuit load which may vary as attached devices change and therefore must be the right match of wire and breaker.