was the child bp. as an adult in which case it possibly is not Roberts sons but Alices from a first marriage but bp in his name to enable him to inherit or something ?
The PR on Durham Records Online gives the baptism thus:
"Baptism St Hilda's Church, Hartlepool.
20 Apr 1788 William Shadforth, born 7 Mar 1788, illegitimate son of Robert Shadforth (jun'r) & Alice (his wife)"
I assume Alice was still alive at this point, or she would have been described as 'late wife', I assume...? However, she was buried on 23rd April, three days later, whilst William was buried on 25th April, aged about six weeks.