The results of CvCity::bestTeachUnitClass seem to be off. I get a high frequency of "Expert Cochineal Collector" even in native cities that cannot produce the yield cochineal at all.
The formula is quite complicated and honestly I cannot make much sense out of it ... maybe someone with a better understanding what happens here could have a look at it?
That is
not a bug - that is
pretty normal. E.g. you may end up having
"Seal Hunters" (in the middle of the map) because the algorithm has
some randomness in there. (Which is good.)
The algorithm uses
"weighting" but it also has some
"randomness". This guarantees to also have chances of getting some Experts that would otherwise be very unlikely.
So please let us
not make a bug out of this just because you got
results you do not understand.

Due to the high amount of Experts we have right now there sometimes may be results like this.
Trust me - the algorithm is
not bugged - it is actually working
nicely since 10 years.
It simply creates results the player may
not always understand.
-----
By the way:
The algorithm also uses the information in
CIV4CivilizationInfos.xml
<TeachUnitClasses/>
While it uses the information of Yields available in the Native Village it also tries to create other results from that file.
(It e.g. counts how often it already created certain Experts and will then decrease their weighting.)