The only claim a pope has to infallibility is when he speaks ex cathedra--and that is exceedingly rare.You just dont get it. No one is contending that JPII infallibly excommunicated Lefebvre. Just that he did it. Infallability isn't even relevant here, its not an issue. An excommunication is not a teaching on faith and morals. Its a disciplinary act, a matter of judgment, jurisidiction, etc.
Yes, Vatican I limited the Popes infallibility. It also, however, made it clear that he has universal jurisdictional authority, which would obviously include the ability to excommunicate. Again, read it, from Vatican I:
8. Since the Roman Pontiff, by the divine right of the apostolic primacy, governs the whole Church, we likewise teach and declare that he is the supreme judge of the faithful [52], and that in all cases which fall under ecclesiastical jurisdiction recourse may be had to his judgment [53]. The sentence of the Apostolic See (than which there is no higher authority) is not subject to revision by anyone, nor may anyone lawfully pass judgment thereupon [54]. And so they stray from the genuine path of truth who maintain that it is lawful to appeal from the judgments of the Roman pontiffs to an ecumenical council as if this were an authority superior to the Roman Pontiff. (Vatican I, Session 4 , Ch. 3, 8.)The sentence of the Apostolic See (than which there is no higher authority) is not subject to revision by anyone,
patent +AMDG