Note that it didn't end very well for India. The initial claims are conveniently forgotten and people just suffered. More than 99% of the currency got returned anyway, contradicting government's claims.
Note that I didn't comment on the outcome, only the intended purpose. I suggest reading the demonization wikipedia article for more examples if the India example doesn't satisfy you.
https://en.m.wikipedia.org/wiki/Legal_tender#Demonetization