Thank you, Shaun, for you further input.
It was only a reference that I had recently found in the Celtic Magazine
https://archive.org/details/celticmagazine06unkngoog/page/n343/mode/2up?q=Lerigan to Jessie MacDonald's father being Lieutenant John MacDonald that made me think that he was an officer. I'll have another look at her marriage records to see if his rank is mentioned.
I must confess that I am not sure that I have seen a specific reference to John McD being Controller/Comptroller of Customs. I was relying on family reports. I think that I have only come across 'of Customs' or 'Customhouse'
http://freepages.rootsweb.com/~coigach/genealogy/articles/18251125ij.htm I had come across the reference to Jane MacKenzie's father being Comptroller of Customs in the Dundonnell Cause proceedings. I thought that he must have been Comptroller prior to John McD.
I didn't know that there were Customs records at NRS, so will definitely try to look at them. I had tried to find them at Kew and the Highland Archive Centre. I had also tried to visit the Border Force National Museum library in Liverpool but it was, unfortunately, closed at the time.