It's a useless move.
I don't think Barrier Alakazam is useful because Alakazam is supposed to be a Special Sweeper. Not a tank. So Calm Mind is more useful. Raising Defense by 2 stages doesn't matter for Alakazam. And a sweeper will never use a Def. raising move instead of an attack or Atk/SpA raising move. It's not even useful for Tank or Wall.
Very few pokemon can learn Barrier, and all of them, I think only Mew (?), Avalugg, Cloyster and Musharna are tanky.
Mew- Why Mew will use Barrier when it can use Wil-O-Wisp?
Avalugg- it's Defense is already high, then why it
will use Barrier instead of Rapid Spin or Toxic?
Cloyster- Its a great Shell Smash user, so it's never going to use Barrier.
Musharna- It is a Special Wall. So it should use Calm Mind. Why will you use Barrier?