Well. The IGI (
http://www.familysearch.org/Eng/Search/frameset_search.asp?PAGE=igi/search_IGI.asp&clear_form=true) lists two marriages of a John McGregor to a Mary Stirling; one is n Eastwood, Renfrewshire in 1816, followed by two children, both born in Eastwood. The other couple were married in Denny, Stirlingshire, in 1840, and had 6 children, including a John, but he was baptised on 1 June 1845 in Denny so cannot be the one aged 29 in the 1861 census. He would have been old enough to marry in 1869.
The 1841 census (
http://freecen.rootsweb.com/cgi/search.pl) lists three John McGregors, aged respectively 9, 10 and 11, in Kirkmichael, Banffshire.
The 9-year-old is in the household of Alexander McGregor, 50, and Christiana McGregor, 45, and their children. This is the one you have already identified as the son of Alexander McGregor and Christina Macpherson.
The 10-year-old is living in the household of Margaret Fraser, 70, Robert Fraser, 35, and Ann Fraser, 30, at Glauchhan. I cannot identify this one from the IGI.
The 11-year-old is in the household of James Fleeman, 40 and Ann Fleeman, 26, and their children. Also there is Charles McGregor, 14. These two will be the sons of Alexander McGregor and Elspet Stuart, who had a Charles in 1826 and a John in 1830 among others.
The family of Donald McGregor and Elizabeth Petrie were born in Kirkmichael, Perthshire, not Kirkmichael, Banffshire. This is a completely different place. (There are 5 parishes in Scotland, all named Kirkmichael; one each in Ayrshire, Banffshire, Dumfries-shire, Perthshire, and Ross-shire - see
http://www.abdnet.co.uk/genuki/BAN/Kirkmichael/index.html)
What was the age of your John according to his marriage certificate?
HTH