It's highly unlikely the witchcraft accusations were caused by ergotism.
It's kinda crazy how easily the ergot theory took over. For 200 years, it was widely accepted that it was a case of mass hysteria, moral panic, and religious extremism. Then someone hypothesized it could be ergotism because the reported symptoms are similar.
And people immediately took it as a fact, because a clear, single cause is much easier to explain.
Y'know, like how they blamed the "witches" for anything bad?
Why didn't anyone else develop ergotism? If their source of rye was contaminated, more people would have fallen ill.
Why did it only affect a handful of adolescent girls, who happened to be friends?
Why did another town 20 miles away have more accusations of witchcraft around the same time?
Why didn't they recognize the symptoms at the time? St Anthony's Fire was well-documented and treatable since the Middle Ages.