When an animal is shipped, ammonia accumulates in the water, but because the bag is closed, the oxygen is used up, CO2 builds up and the pH of the water drops. The hydrogen ions then interact with the ammonia to form NH4+, which is less toxic than plain ammonia. But when you open the bag, the CO2 leaves the water, oxygen diffuses back in and the pH raises back up, converting the NH4+ back to the more toxic ammonia.
So what might have happened is that while you were acclimating the fish, the water became too toxic for them to survive.
When i receive fish that have been shipped to me, I just temp acclimate without opening the bag and then transfer the fish right to new water. They can handle the change in salinity more than the ammonia.