Just part of the pet-trade, nothing you could've done. Probably some fungus/virus or disease. Hatchlings at petshops have a high mortality rate.

Good luck with the other. It should survive. But about the nail being ripped out, it probably just got bit off. The lesion on its neck probably had to do with its dying.