Not valid. What do you think the whole purpose of wxcommunication is all about? It was not just proests expelling heretics. It was also about shunning even of of priests ftom the congregation,s that profaned Gods will.
Defending the church against heresy is a completely different matter from avoiding sinners in general. Scripture is quite clear on the matter. If a brother, in other words a fellow believer, sins, we are supposed to help them repent and rejoin the fellowship. Correction should be done out of love, not anger, and the goal is to restore the brother. Unbelievers, on the other hand, haven’t repented and aren’t members of Christ’s church. The goal there isn’t to restore a believer so much as to make a sinner aware of their sinful nature and the salvation and forgiveness offered by Christ. Christ visited sinners and sat down to eat with them. If we don’t do the same, then sinners will never hear the word.