Phantom Liberty codes included in Ultimate Edition boxes can only be redeemed on a PSN account with the correct country/region, so make sure to purchase the game in a country/region matching your PSN account's country/region*. Find the list of all PlayStation countries/regions here.
Note: Copies for the European Union countries can be redeemed on accounts with PSN countries that are European Union countries.
* Before purchasing the game, always make sure with the shop which region the game is from. Some shops have non-local versions in their offer.