Can we go back to your original post, please?
You say:
Doing my own research I was under the impression that his grandparents were a James McGregor, born in 1792 in Perth but died in Tramore Bay near Waterford in Ireland and that his grandmother was a Jannet Ritchie, born 14th March 1774 in Glasgow, Lanarkshire (a bit of a wide age gap I know).
and in reply No 7 here:
https://www.rootschat.com/forum/index.php?topic=893467.msg7677302#msg7677302there is a screen shot of a Roman Catholic baptism for a Robert McGregor in 1816 with these parents named.
Please think about this carefully. If it is true that Janet Ritchie was born in 1774 and James McGregor was born in 1792, then he was 24 when his son was baptised
in a Church of Scotland (i.e. presbyterian) church. And his wife was 42.
Edited: Your Robert married in a Church of Scotland church, but according to the baptism you had identified as a possible record for him, his family was Catholic.
Searching the Catholic records on ScotlandsPeople, there are baptisms for the following children in the same district with the same parents named:
1802 Margaret (ages of parents 10 and 28)
1805 Mary (ages of parents 13 and 31)
1807 Jannet (ages of parents 15 and 33),
1819 Colin (ages of parents 26 and 45 for the mother)
(ScotlandsPeople is now misbehaving and I can't get to further results

)
However, I think this is fairly conclusive that the parents of Robert McGregor who married Helen Porteous are NOT James MacGregor and Jannet Ritchie, who seem to have been resolutely Catholic.
I think other possibilities need to be considered.
Nell
Edited: Robert born cir 1816 married in a Church of Scotland church, but according to the baptism you had identified as a possible, his family was Catholic.