Was alnwick castle ever in Scotland?
No it was built after the border was established and used in defense of the border by the English. William I of Scotland did inherit the title Earl of Northumbria but gave it up to Henry II of England before he became King of Scotland. He spent considerable time and energy trying to take back Northumbria but was captured outside the castle and was eventually ransomed.