I was captured and eventually released when an ensign. I beached another ship to avoid defeat as a Commander. But as a commodore, I won my nation's only significant victory of the early 19th century.
HiHi
?? Commodore Perry
All the Best
Peter
How about Edward Preble? Not sure about the grounding incident being a fit though.
Rick
No to Thornbrugh and Preble.
When I saw Andre's answer, I reread my initial riddle and realized it was not clear or maybe even misleading.
So, I rewrote the last sentence for additional clarity. It should now be clear the no member of the Royal Navy will fit the riddle.
Unless you think the RN only had one significant victory in the early 19th century.

HiHi
Not 100% sure on this Mike but fairly certain Ensign ain't a RN rank, they were known as Midshipmen or later Cadets.
All the Best
Peter
How about Commodore William Bainbridge.
HiHi
Lets try what I think is the only French naval victory over the English in the Nap wars at Port Louis Mauritius in 1810, the french being led by Commodore Guy-Victor Duperré.
I think it was the last Naval defeat for the RN till Corronel in 1915.
All the Best
Peter