Whatever the facts, it is a great story. I read it in Robert the Bruce, King of Scots by Ronald McNair Scott, 139. The reference for it is indeed Sir Walter Scott, Tales of a Grandfather, 164.