It was certainly customary for men in ancient Egypt to follow the profession of their fathers after coming of age, but Adam Smith was wrong to claim that men were "bound by a principle of religion" to follow the occupations of their fathers.
For example, the Instruction of Dua-Khety, also known as The Satire of the Trades, shows quite clearly that sons could follow different professions from their fathers.
The text dates from the Middle Kingdom, and tells us a lot about life in Ancient Egypt. It takes the form of advice from a father to his son Pepy. Unlike his father, Pepy had been sent to learn to be a scribe at the 'School of Books' [Ann Rosalie David: A Year in the Life of Ancient Egypt, 2015].
The text emphasises how much better Pepy's life will be if he became a scribe, rather than working in a manual occupation.
"Since I have seen those who have been beaten, it is to writings that you must set your mind. Observe the man who has been carried off to a work force. Behold, there is nothing that surpasses writings!"
Like any father, he wanted his son to have a better life than he had.
Interestingly, it has been known that people in Ancient Egypt were not forced to follow the occupations of their fathers since the early nineteenth century. Writing in 1836, J. Gardner Wilkinson observed:
...a man did not necessarily follow the precise occupation of his father. Sons, it is true, usually adopted the same profession or trade as their parent, and the rank of each depended on his occupation; but the children of a priest frequently chose the army for their profession, and those of a military man could belong to the priesthood.