If their rules has a serious negative effect outside of their group...
Why stop with shunning? Ask any atheist - religion as a whole has a “serious negative effect” on society. I am troubled that you can’t see the negative side effects, the unintended consequences, your proposals will have to a true free society.
The bottom line is this:
When people are threaten by organized shunning, can we say that they are free? We are supposed to be a free society, however, these abusive religions create a sub-society where these rights are abusively taken away from them. This is where society as a whole is seriously impacted.
Who is “threatening”? Can you define that term and it’s boundaries? Who gets to interpret that? You? Who gets to decide if a religion is “abusive”? You? The members of the religion, whatever it might be, surely disagree.
What “rights” are taken away from the shunned? The right to associate goes both ways, and it seems you wish to force one side to associate at the expense of the other. And you don’t see the long term harm in such a stand? You honestly don’t see how that power, when given to a government that you won’t control forever, can’t be used against you?
I think you are conflating freedom with emotional safety.