Under Vatican rules a Pope could deposed by a Conclave of the College of Cardinals.
However,Popes John XII( 955~964) & Benedict V (964,for one month) were both deposed.This was the time of the 3 Popes,and the Holy Roman Enperor Otto deposed them to get the Papacy back to normal,and backed Leo VIII.
Popes Sylvester III,Benendict IX and Gregory VI,were deposed by a Council of the Church as their elections were considered questionable.
From 1268 to 1271 these was NO Pope at the Cardinals could not make up their minds!
This was repeated 1292~1294.
Poep Celestine abdicated 1n 1296 after being Pope for only two years.
After this the Conclave came into being,as opposed to just a loose discussion on who should be Pope.
1314~1316 no Pope,much good the Conclave was,they still couldn't agree.
1415~1417 the Conclave couldn't agree again,so elected TWO Popes!
So as you can see it was all go in the Papacy early on.
This is a catch 22,because the Conclave can only be convened (by the Papal Chamberlain) on the Death of a Pope,so if the Pope is alive they cannot be convened~ so cannot depose the incumbent Pope.