I don’t think you have a correct understanding of excommunication.
From Catholic apologist Dave Armstrong’s apologetics web site:
The following citation taken from Fr. Bertrand L. Conway’s The Question Box, New York: The Paulist Press, 1929, 205:
Neither excommunication nor anathemas imply the Church’s condemning anyone to hell. That is the prerogative of God alone. Excommunication is a Church law, excluding a notorious sinner from the communion of the faithful (Canons 2257-2267). Its purpose is to warn the sinner of the danger he runs of incurring eternal ruin, unless he repent of his sin.
And from the same web page, Mr. Armstrong quotes from another Catholic author, Mr. Karl Keating:
Karl Keating, What Catholics Really Believe: Setting the Record Straight: 52 Answers to Common Misperceptions About the Catholic Faith, San Francisco: Ignatius Press, 1992; reprinted in 1995, #5: “The Catholic Church sends people to hell by excommuniucating them” (pp. 17-18):
It doesn’t. Only God can condemn anyone to hell. That isn’t within the Church’s power, and no Catholic ever claimed it was. The Church’s role is to help people to heaven by teaching and sanctifying. Of course, people can ignore the teaching and reject the grace. If they do and end up in hell, they go there by their own choice.
Excommunication is a Church penalty which excludes a notorious sinner or someone grossly disobedient from the communion of the faithful. It doesn’t mean the person ceases to be a Christian. its purpose is to warn the individual that he risks losing his soul unless he repents.
And from the Catholic Encyclopedia article on excommunication, cited also by Dave Armstrong:
Undoubtedly the Church cannot (nor does it wish to) oppose any obstacle to the internal relations of the soul with God; she even implores God to give the grace of repentance to the excommunicated (Catholic Encyclopedia, Volume 5, 1909, “Excommunication.” newadvent.org/cathen/05678a.htm)
I suggest further reading…
Anathema by James Akin
And this Catholic Answers forum discussion here:
Does excommunication condemn a culprit’s soul to eternal death?