I keep thinking that I've seen it all in terms of census entries, then this example pops up!
It's important to understand the process; the enumerator hands out the schedule, then collects it, and transcribes the info into the enumeration book.
#1 chance for an error to creep in.
If the householder had been unable to complete the schedule, the enumerator may have done it for them. Not necessarily a question of illiteracy, BTW, more often a question of unfamiliarity with a form such as the census household schedule.
Accents frequently caused problems if (a) the head of household wasn't originally from Scotland, - I've seen some real "beauties" deriving from a broad Ulster accent, and (b) many enumerators were incomers to the area, it being more often that not the case that enumerators who were ministers or schoolteachers were from outwith the area so, in their early days at least not always fully familiar with local accents.
#2 chance for an error to creep in.
And then there's the oft quoted results of data inputters in India, Sri Lanka, The Phillippines, Taiwan, etc., who have been given less than perfect training in terms of handwriting styles of the era, Scottish given names, surnames, place names, and occupations. No names, no pack drill, but one large website excels above all others !!
These data inputters don't have the luxury of preexisting knowledge of the families involved, nor the time to do some lateral searching to clarify a difficult entry.
#3 chance for an error to creep in.
To be strictly fair to modern name transcribers/data inputters there are some peculiar hands out there and some less than ideal images, in particular the 1851 census in Scotland which is in the process of being re-digitised.
And further, there are some highly accurate transcriptions out there, particularly FreeCen and FHSs, most of which use a true double entry approach. [True double entry involves two transcribers independently inputting the data. A third person then compares the inputs and resolves any differences. If there are still problems, then the situation is referred further to top experts.]
The solution is deceptively simple, for the Scottish records, at least on ScotlandsPeople.
This is to invest some time in learning how to use wildcards.
However much you believe that you know all the possible variant surname spellings, I can guarantee you that the situations above will produce variants that you haven't previously come across; never mind general variations in spelling.
OK, it can sometimes take quite some time playing about with various wildcard searches but my general experience is that there will most often be a result ! Remember that ScotlandsPeople allows the use of an initial wildcard, as individual styles of initial capital letters could be quite ideosyncratic !
I've long since given up assuming that a certain surname can only have spelling diffences in 'obvious' parts of the surname, - this situation being a quite brilliant example.
And don't just concentrate on surnames at the risk of ignoring given names. For example, here, was the given name 'Henry' or 'Hendry' or various possible renderings of these ?
ibi