Hello and a very warm welcome to RootsChat.
The military record I looked at for Edward indicated he joined up 16 Jan 1864 and was discharged 06 Dec 1865. I don’t see anything about desertion and I don’t think he would have been allowed to be buried in a National Cemetery if he had. It appears to be an honorable discharge.
Edward Haig and Wilhelmina Smith were apparently married 25 Mar 1870 at Coylton Ayr Scotland (transcript on ancest..ry).
And….
Since he married in Scotland after 1855 his marriage certificates should have the names of both his parents. There is no guarantee that this would be the case for Edward but the only way to find out is to order one or both certs. This is done through the scotlandspeople (SP) website…they would not be on line. It is free to join. Link….
https://www.scotlandspeople.gov.uk/In case you haven’t seen it, this other link is to the Roots Chat Scotland board. If you scroll down to the pinkish area there are some hints for Scotish research, like how to how to optimize scotlandspeople searches.
https://www.rootschat.com/forum/scotland/PB