It has happened before in the late 14th to early 15th century with a pope in avignon France, Pisa Italy and Rome. All 3 were deposed at the council of constance where martin V was elected.
Popes and antipopes, it seems like an antipope took over the modern church.
It had happened before that about 1046 when there were three men all claiming to be pope. The emperor forced all three to give up their claims and had a new pope elected.