That doesn’t sound like a lawful canonical process.
It isn’t. There is not a word in the Code of Canon Law about the removal of a Pope—or even the resignation of a Pope. But since the Pope has absolute power (limited, of course by moral and divine law) he can always resign, as Benedict did.
If a Pope came to be universally judged a heretic, he would have to resign because, literally, no one would answer his buzzer.