1841 census has John McRobert, 40; Mary, 30; John, 10; Nichol, 8; Robert, 4; Charlotte, 1; Charlotte Lindsay, 60. If that is accurate he was indeed born in 1830/1831.
In my opinion any census indexes or transcriptions that say he was 29 in 1851 are wrong. See the attached screenshot, which gives the ages as John, 20; Nicol, 18 and Robert, 14.