Yes, if your goal is to silence someone, shut them down, or bully someone, then it works. But shaming another person is never acting in love or kindness, or wanting the best for the person. It never motivates change within a person for the right reason. And it leaves scars.
Often the goal of shaming another person is to make that person feel inadequate and ashamed. To humiliate them and put them in their place (which it does).
Shame reveals more about the person who is shaming, than it does the other person.
Go deeper, read Why We Use Shame on Others and Ourselves: 6 Eye Opening Reasons, post 9.