As oftimes before; many thanks Shirley, for sharingyour expertise in these complicated families. You seem to have reams of documents in your head!
I should have been more careful with my pronouns; I didn't mean that the second Ninian was grandfather of the father of Archibald. I think the ODNB author has confused Archibald's father Ninian with an earlier Ninian, who is possibly Archibald's grandfather. It seems to go Archibald, Ninian, William, Ninian, isn't that right, and I think it is the earlier Ninian who married Agnew.