A shark that has been trapped in Cottesloe’s barrier since Wednesday morning has finally been freed after being shot with a speargun.