I think you may have been taught correctly, but you're just confusing how "children's" is being used. You seem to be viewing "children's" as a plural noun, when in this sentence it's really functioning like an adjective. Since it's functioning as an adjective, treat it like you would any other adjective. The doctor doesn't belong to the children, children are simply the doctor's specific area of specialization (otherwise known as pediatrics).
Since the next word following the article begins with a consonant sound, use 'a' instead of 'an', unless you need the definite article. (I believe this is probably what you mean by "what I was taught").
Some examples:
A good doctor
An excellent doctor
A children's doctor
A heart doctor (aka cardiologist)
The good doctor
The excellent doctor
The children's doctor (here it could be referring to the doctor attending specific children)
The heart doctor