The quickest and easiest way to find out who Robert's father was is to download a copy of his death certificate from ScotlandsPeople (www.scotlandspeople.gov.uk) - this should have details of both his father's and mother's names, providing that the informant knew them.
A less definite way is to use the indexes available on ScotlandsPeople - assuming that the dates you've given are correct.
There is only one death of a Robert Moffat in 1877 in Scotland who was born within 5 years of 1796. The index entry for that death:
MOFFAT, ROBERT, 81, BAIRD, M, 1877, 652 / 2 / 45, Old Monkland (Middle District)
shows that he died in the Old Monkland (Coatbridge) district of Lanarkshire and that his mother's maiden surname was "Baird"
Going to the OPR (Old Parochial Registers) baptismal indexes, there is only one baptismal entry in the whole of Scotland prior to 1805 for a Robert Moffat with a mother's surname of Baird:
MOFFAT, ROBERT; ROBERT MOFFAT/JANET BAIRD FR169 (FR169); M; 17/07/1796; 652 10 / 175; Old Monkland (Middle District)
so we can infer that your Robert's parents were Robert Moffat and Janet Baird and that he was baptised on 17 July 1796 (assuming that his death year is correct, that he was actually baptised in the Church of Scotland - other denominations were available - and that his baptism was actually recorded)
Incidentally, the Clan Moffat Society website has a Robert Moffat and Janet Baird couple with a son Robert baptised on the same day as yours but they have Robert married to an Elizabeth Mackie (https://genealogy.clanmoffat.org/familygroup.php?familyID=F6369&tree=UKEire)