The Mexican War was the only combat he saw up until the Civil War.
That could also be said about most of the generals in the war. U.S. Grant, "Stonewall" Jackson, George McClellen, Braxton Bragg, Lewis Armistead, Winfield Scott Hancock, Philip Kearny, George Mead, William Sherman, Joe Johnston, James Longstreet, A.P. Hill, George Pickett and a load of others. Some were good some weren't. Other great leaders never served in the military at all before the war, Nathan Bedford Forrest and John S. Mosby are two. Your statement has nothing to do with Lee's abilities as a military leader.