Remember there's a layer of military usage with Invictus as well.
Even after they've all retired, those junior often still call commissioned officers and senior NCOs "Sir", and wives of officers default to "Ma'am" (until they tell you to stop it) which does save quite a lot of name remembering!
But of course, it's a bit different for the Sussexes, as a) IG people will all know their names and b) Harry, though commissioned, was not particularly senior.
It was a bit weird - in some circumstances, the Waleses would call DH "Sir" and salute him (ie in strictly military formal environments as he outranked them), but in others he would call them "Sir" (representational) and salute them. Or at least I think that's how it worked.
I think the way the Sir/Ma'am thing is being reported looks bad for the Sussexes, as it's widely seen as standing on rank, so it's a shame it was said at all. The "just call me Harry" was a better stance