This comes from a comment in an article in a Moroccan news site.
According to the encyclopedic book Social Glimpses of Iraq's Modern History by Ali Al-Wardi, during a cholera pandemic in Iraq under Ottoman rule (possibly around 1852,) the Jews of Iraq locked themselves in homes by order of the rabbis - and they were saved from death.
When Muslims asked their clerics what to do, they were told to say the words, "Allah will not afflict us except for what he has already ordained."
Entire Muslim villages and cities were wiped out.
I am curious as to how true this is - I am not aware of any time before now that rabbis ruled that Jews should stay in their houses even at the expense of prayer with a quorum, but this story makes it sound like is did happen in the mid-19th century. I'd love to verify this - we definitely need more source materials on the lives of Jews in the Middle East throughout the ages.