The tune was composed by William Mackay.
The original title was indeed "The Boy's Lament for His Dragon", and only later became the 72nd's Farewell to Aberdeen"
The titles of Scottish pipe marches were often changed by their composers (although I don't know whether this is true in this case).
But consider that well-known Scottish tune: "The Road to the Isles". It was written by Pipe Major John MacLellan, and he orginally entitled it: "The Bens Of Jura".
During the South African War he changed the title to: "The Highland Brigade’s March To Heilbronn", (MacLellan had by this time enlisted in the Brigade).
Thereafter, on being posted to Egypt, he renamed it again - this time to: "The Burning Sands Of Egypt".
It only became a song later on (circa 1914) when Kenneth Macleod wrote "Road to the Isles", setting it to that tune.