Correct, in the Church this is called excommunication
That is such an unnecessary extreme to take it to. You can and should tell someone something that may hurt them momentarily if it helps them and the community in the long run. That doesn’t require excommunication.
Excommunication is widely misunderstood. It's very different from shunning, in which the other person is "dead" to you. Excommunication's goal is reconciliation and healing. The nominal separation is only a recognition of what is already true, just as amputation of necrotic flesh is a recognition of cell death. Romans 11:23 talks about this reconciliation in this way: "And if they do not persist in unbelief, they will be grafted in, for God is able to graft them in again."