Using the name William McHardy Duncan I’ve just searched Scotland’s People for a death (using only William Duncan),  anywhere in Scotland, between 1926 and 1960.  It returned 33 pages!  But it’s ‘lockdown’ so I was happy to take the time to scroll through all the pages!  Two deaths caught my eye.
1  Willian Hardy Duncan, died 1926, RD St Nicholas (not sure what area that is)
2  William Allardy Duncan, died 1928, RD Rubislaw ( which is in Aberdeen)
The name McHardy, when written at speed and possibly without care, could be misread as Allardy - I’ve just tried it!   I would think that in the 1920s registering a death would require a birth certificate to be produced and maybe a ‘best guess’ at the middle name badly written on the birth certificate was Allardy.    Just a thought!
Anne