On a dark night in the summer of 1908, the USS Decatur (DD-5) was silently pulling into Batangas Harbor in the Philippines. While making her approach, the Decatur ran aground on a mud bank and had to be rescued the next day by a local steamboat. The young commanding officer immediately reported the incident, took responsibility for the grounding, and was court-martialed and summarily relieved of command. It might surprise you to know that the CO in question was none other than Ensign Chester W. Nimitz.
Despite this notable naval no-no, the ensign was able to salvage a serviceable career in the U.S. Navy, retiring 39 years later as a five-star admiral. There are many examples of great military leaders (including Lieutenant General John A. Lejeune, General George S. Patton Jr., and General Henry H. "Hap" Arnold) who survived major mistakes early in their careers.