Objection 2: Further, Jerome says (on Mat.16:19: "I will give to thee the keys"): "It is a pharisaical severity to reckon as really bound or loosed, that which is bound or loosed unjustly." But that severity was proud and erroneous. Therefore an unjust excommunication has no effect.
On the contrary, According to Gregory (Hom. xxvi in Evang.), "the sentence of the pastor is to be feared whether it be just or unjust." Now there would be no reason to fear an unjust excommunication if it did not hurt. Therefore, etc.
I answer that, An excommunication may be unjust for two reasons. First, on the part of its author, as when anyone excommunicates through hatred or anger, and then, nevertheless, the excommunication takes effect, though its author sins, because the one who is excommunicated suffers justly, even if the author act wrongly in excommunicating him. Secondly, on the part of the excommunication, through there being no proper cause, or through the sentence being passed without the forms of law being observed. In this case, if the error, on the part of the sentence, be such as to render the sentence void, this has no effect, for there is no excommunication; but if the error does not annul the sentence, this takes effect, and the person excommunicated should humbly submit (which will be credited to him as a merit), and either seek absolution from the person who has excommunicated him, or appeal to a higher judge. If, however, he were to contemn the sentence, he would "ipso facto" sin mortally.
But sometimes it happens that there is sufficient cause on the part of the excommunicator, but not on the part of the excommunicated, as when a man is excommunicated for a crime which he has not committed, but which has been proved against him: in this case, if he submit humbly, the merit of his humility will compensate him for the harm of excommunication.
Reply to Objection 1: Although a man cannot lose God's grace unjustly, yet he can unjustly lose those things which on our part dispose us to receive grace. for instance, a man may be deprived of the instruction which he ought to have. It is in this sense that excommunication is said to deprive a man of God's grace, as was explained above (A, ad 3).
Reply to Objection 2: Jerome is speaking of sin not of its punishments, which can be inflicted unjustly by ecclesiastical superiors.