If shunning assumes the shape of a "ritual punishment by not talking/phoning" would be very sad. The nasty "shunning" behaviour of the congregation should not be a reason for someones falling into yet deeper problems, suicide, drugs, atheism,...
Besides the considered aspect "purity" of the congregation, the personal development and future of a person is a indispensable and obvioulsy most important part of the whole matter concerning responsibilt especially for jounger members. Therefore a gradual form of disciplination withouth causing someone to stumble would be "a biblical" answer in a "community of disciples" like exclusion from taking bread or wine or.. But why everything has to be public announced at all arent there other measures that are more senseful.
Matthew prompts (Ch.18) the whole congregation to think about the consequences if one of the "little ones" or "wandering sheeps" would perish by overhastly reaction or judgments of "unmercifal servants", what is a warning not only for "elders", but for each "sister" and "brothers".
"It would be better for them to have a large millstone hung around their neck and to be drowned in the depths of the sea".
Who is really appropriate to bring someone back on the "right" track? Only few women and men are really appropriate to do such an important job in a "community".