If that drawing is correct the solution is to demolish the stone shed and rebuild another which joins onto the house and eliminates the neighbour's claim they have a flying freehold as they will have to prove where the boundary line is in their own title deeds.
The purchaser has legal redress to sue the seller as it has to be divulged in the solicitor's paperwork which is compiled before exchange of contracts.