You are correct in that many Catholics don’t understand the difference between ecclesiastical (ie. canon law) and divine law (and what happens when a pope loses the papal office through heresy).
Since you aren’t even Catholic (which I had forgotten), it is understandable why you don’t understand it.
Given that fact, I won’t even bother to get into this with you. I thought I was talking to a Catholic.
I’ve found the RC to be frustrated when confronted by their own dogmas and laws when they don’t like them.