Just a random thought.
I cannot see that anything says he was a Major at age 20 at the Battle of Waterloo. He may have been a junior officer. during the conflict.
It is conceivable that Major was the highest rank he attained after having fought at Waterloo, after he came to the Cape with Lord Charles Somerset and maybe rose to that rank under Somerset in the Cape.
Needs more research to be certain either way.
Good points John.
Apparently in later years, William applied to have his mother Ann move to South Africa. I know nothing more about the outcome of that. Despite that, many trees show Elspet Wilson as his mother. I have been told that in fact Elspet gave birth to a child 3 months after the birthdate used for William Ogilvie.