The idea of the Duchess of Alba being the next Queen of Scotland is based on the fact that she's the senior descendant of James II through his son James FitzJames, 1st Duke of Berwick. What it doesn't consider is FitzJames being James II's illegitimate son - as such neither he nor his descendants have any claim to any of James II's titles. Which means that the Duchess of Alba is not actually a possible pretender to the Scottish throne.
The Duke of Bavaria is a pretender, though. He's the senior line descendant of Charles I through Charles' daughter, Henrietta Anne. The eldest surviving son of Charles I, Charles II, had no legitimate children, and the legitimate line of the younger son, James II, ended in 1807 with the death of James' grandson, Henry. Charles I's eldest surviving daughter had one son, William III, who died in 1707, leaving only the descendants of Henrietta Anne, his youngest child.
There is a second pretender, the Dowager Duchess of Calabria. She is also a descendant of Henrietta Anne, and her claim comes from the basis that the Duke of Bavaria's great-great-great-grandmother (through whom his claim descends), Maria Beatrice of Savoy, married her uncle. This was valid in Sardinia, making the children from it legitimate (including the Duke's great-great-grandfather), but would have been invalid in Britain. The argument there is that under British law, the descendants of Maria Beatrice would have been illegitimate, so the Jacobite succession would then pass to the descendants of her sister, Maria Teresa. The Duchess of Calabria is the senior-line descendant of this claim.
Of course, then there's the line of Elizabeth of Scotland, only daughter of James VI and I. When faced with the fact that Queen Anne had no children, English and Scottish Parliaments considered the issue and passed the Succession Act, naming the descendants of Elizabeth's daughter, Sophia, as the only possible heirs to the throne. While it can be argued that the English Parliament pushed this act on the Scottish one, it still remains that it was passed and the heir of Sophia came to the throne - George I. Today Elizabeth II is the senior descendant of that line.
As such, there are three legitimate possible contenders to the Scottish throne if it separates from the UK - Elizabeth II, the Duke of Bavaria, and the Dowager Duchess of Calabria. Not the Duchess of Alba.