The tithe applotment records for 1828 lists 5 Gray farms in the parish of Maghera. 2 in Ballynacross (James & John), and 3 in Ballymacilcurr (Robert, Samuel & John).
http://www.irishgenealogyhub.com/derry/tithe-applotments/maghera-parish.php
I searched the 1831 census for the parish of Maghera.
James Grey in Ballynacross:
http://www.census.nationalarchives.ie/pages/1831/Londonderry/Loughinshollin/Maghera/Ballynacross/31/
John Grey in Ballynacross:
http://www.census.nationalarchives.ie/pages/1831/Londonderry/Loughinshollin/Maghera/Ballynacross/32/
George Gray in Ballynacross:
http://www.census.nationalarchives.ie/pages/1831/Londonderry/Loughinshollin/Maghera/Ballynacross/37/
George seems likely to have been a labourer then as he isn’t in the tithes and therefore didn’t have land at that time.
Here’s another John Gray. He had 1 + 2 in his household, plus some servants. He was an Esq indicating he was probably of independent means. He was Presbyterian.
http://www.census.nationalarchives.ie/pages/1831/Londonderry/Loughinshollin/Maghera/Ballynacross/35/
These 4 houses were all close to each other suggesting they may be related.
James had 2 + 4 in his household so that could include children. The others don’t appear to have had any spare males.
I also noted this Samuel Gray in Ballymacilcurr. That’s a townland a mile or so outside Maghera:
http://www.census.nationalarchives.ie/pages/1831/Londonderry/Loughinshollen/Maghera/Ballymacleewe/10/
This Samuel had a household comprising 3 males and 2 females and they were also all Presbyterian (so probably descended from Scots settlers in the 1600s).
Griffiths Valuation for 1859 lists Samuel Gray in the townland on plot 12 in the townland. He had a one third share of plot 12 a 17 acre farm. Today it’s still agricultural land but the farm house is gone. It’s down a lane off the Ballymacilcurr Rd, though you would need to cross a couple of fields now to get to where the farm was located.
http://www.askaboutireland.ie/griffith-valuation/index.xml?action=nameSearch
The Valuation revision records show Samuel deleted in 1863 suggesting either he had died or moved away.
Griffiths Valuation for Ballynacross lists several Gray properties. I also see some marriages for children from Ballynacross in the statutory records. None for the Ballymacilcurr family.
If you can locate John Gray’s death certificate in Australia and get his parents names from that, it may help decide which of these may be his family. (The 1850 Scottish marriage is before the start of statutory registration in Scotland and probably doesn’t have parents’ names).
There will be no record of when John went to Scotland. That was (and still is) just a short domestic journey and no passenger records were ever kept of those journeys. He probably went when he was 16 – 18, so in the 1840s.
John & Ann looks to be listed in Falkirk in the 1851 census GROS ref 479/22/23 (aged 25 & 20 respectively).
If the family were Presbyterian as seems likely to me then the bad news is that none of the 3 Presbyterian churches in the area has any baptism records for the period you need. Maghera Presbyterian has the oldest records and they only start in 1843. (The previous Minister the Rev Kennedy was noted for not keeping any records during his 40 year tenure, though in part this may have been because the church had been burned in the 1798 uprising and it was 30 years before it was rebuilt.).
Tradition was to marry in the bride’s church./ This marriage for a Ballinacross Gray was in Curren Presbyterian church, suggesting it was her family’s church:
https://civilrecords.irishgenealogy.ie/churchrecords/images/marriage_returns/marriages_1849/09373/5394983.pdf
They have no baptism records before 1900 and no marriages before 1845.