The problem is who determines this? The Church is a perfect society. This means she has the sufficient means to reach her end. The members have subordinating hierarchical roles. Who decides definitively that one is not a member? It would seem competent authority as in any society. Pope Pius XII is very clear on this in his encyclical on the Mystical Body of Christ.
This does not mean that if you or I became pope that we couldnt as our first act declare him excommunicated. It just simply means we are not competent to declare him excommunicated as a juridical punishment or to declare in the name of the Church that he has excommunicated himself as a point of law.
Superior est judicatur.
Yours seems to be the generally accepted view.
I’m still thinking.
Did God really intend for us to be in thrall to such a terrible man? Maybe, I guess.