From what I read on Xunzi, humans need education and ethical norms in order to remove their natural evil. Since masters are humans giving education to their disciples there appears to be a logical error, because it would be impossible to have someone "good" in the first place. Where does the first master come from, if there is no master to teach him to be "good"?
Xunzi famously argued that the human nature is evil, and thus for human beings to live in peace and harmony, they need to learn from sages (masters) 禮, and live according to the teachings of 禮 (禮 is pronounced in Korean 'ye,' meaning manners or rite or rituals; I do not know the Chinese pronunciation). Examples of 禮 are being an obedient son and wife, and performing sacrifice for the dead ancestors. This is an example of the Korean sacrifice.
Practicing 禮, according to Xunzi, is the way to transform our nature: from the innate evil tendency to the acquired, good characters.
The question is, "Where does the first master come from?", or more precisely, "How the person discovered 禮, given that there were no other masters to teach him 禮 and that he himself should have been innately evil?"
Xunzi almost answered this question with his famous metaphor of crossing a treacherous river. To cross the river, someone should have placed marks to indicate where is safe to step on. To Xunzi, the person who puts the marks is a master, marks are 禮, and the treacherous river is the innate human nature. When we follow the marks in the river, we will safely cross the river. Likewise, when we practice 禮, we will live peacefully and harmoniously together. Xunzi maintains:
Rituals provide the footing upon which people walk. If you lose this footing, you will certainly stumble and fall, sink and drawn." (I borrow the English translation from Effortless Action: Wu-wei As Conceptual Metaphor and Spiritual Ideal in Early China: Edward Slingerland, p.241)
Once we understand that the masters are markers for a safe cross, it is pretty common sensical how the first master could have been made, as explained in http://www.iep.utm.edu/xunzi/#SH3d. The first master is like the person who first started to mark the fords. Nobody was born to know where the fords are. It would have been most likely a matter of trial and error, perseverance, talent, luck and vision. Likewise, the 禮 that worked for a given society would have been a collective, generational process of crafting.