Under 1 Corinthians 5:1-5, in the case of the man having an affair with his step mother, we have several models of what Paul might mean by handing the man over to Satan. If that meant excommunication, it would be the only case in the New Testament. And excommunication has nearly always been unjust and inappropriate when used in the history of the Church, as it was in this case of Diotrephes' power seeking (3 John 9).
The preferred model in 1 Corinthians 5:1-5 was that even criminals have a right to communion in our churches. It is precisely as they take communion with us that the Holy Spirit is able to reveal Jesus to them and correct their heart attitude. What Paul recommended was handing the person over to be tried for incest by the civil authorities.
The reason Diotrephes could not follow that route was that it was not
a civil crime to welcome others. From Diotrephes' point of view the opposition
had to be silenced, and this was best done by expelling any who might side
with Paul. This is often the motive for excommunication as practiced in
our churches. "Keep out and get rid of any who refuse to toe the party
line." Which of course means that the very people who could be creative
and renew our denominational life are marginalized.