Meaning of the expression 黄毛小儿 Is 黄毛小儿 a sort of idiomatic phrase? Literally it would mean a "yellow haired child."

I saw it on a TV drama, but from the child in question was definitely not yellow haired. Since the speaker  was speaking rudely, I'm assuming 黄毛小儿 is supposed to have a derogatory meaning and probably means something like a naive or foolish child.
naive or foolish child


This is right (except maybe foolish is a bit harsh). 黃毛 literally refers to foetal hair (alternatively 胎毛), the hairs on a newborn that will fall off later. The hair is unpigmented which contributes to its name (in contrast to the black colour found in most East Asians). The metaphor here is young/immature/inexperienced/silly.

Similar phrases include 黃毛丫頭 (specifically for girls, as 丫頭 refers to the hairstyle of girl servants in the olden times).