If you exhaust your restricted supply of Premier Balls by defeating Giovanni without successfully catching his Shadow Legendary, it will depart the battle. You must then equip another Super Rocket Radar and confront Giovanni again in the future in order to earn another chance at catching a different random Shadow Legendary.