Hi Gillianne,a difficult one.My grandfather was also born illigitimate and given his mother's maiden name despite the fact she was known at the time by her married name (she was a widow at the time).The children from her first marriage kept their birth surnames,my grandfather his birth surname and his youngest sister had the surname of my great grandmother's second husband.But I would think there would be nothing to have stopped them all by being known by the surname of her second husband.
In 1881 John and Grace are at Monkton Hill Cottage in Monkton.John,like Margaret is a farm worker.Is it possible they could have met through work.Was Grace still alive in 1882,if so could this have been a reason for Andrew having Margaret's surname and them being prevented from marrying then.One thing is certain,they were both in the Monkton area at the time of Andrew's birth.This isn't to say that John was Andrew's father but it's a possibility.Finding Grace's DC might be worth looking for.