One big problem: define "expert".
Without an exact number, I agree that it takes many years of effort to become expert in a single broad field of programming.
Many trades follow a pattern of apprentice / journeyman / master.
Looking up my state's licencing requirements for several trades (electrician, plumbing, carpentry, etc.) a Journeyman's License (which is required to start your own business in several trades) requires about 1000 hours of classroom instruction plus about 8000 hours (4 years) of professional experience as an apprentice under the supervision of a more experienced tradesman. To get the "Master" title (allowing you to train apprentice workers) requires another 4000 hours (two years) of work.
For programmers, I think it does take about 5 years (10,000 hours) of varied experiences before mastery is achieved. Before that most people need a combination of tutoring, direct supervision, and other critical review of their work. Even after that point there should be continuous cross-checking of their work (usually in the form of buddy checks) just as other fields have inspections and reviews even when the work is done by journeyman or master level craftsmen.