I had quite a few unexplainable fish deaths when I first started, but as my tank matured then these all stopped. It's very stressful for a fish to be transported to the shop, put into new water, chased around and netted, transported home and put into another tank of new water. Then pecking orders have to be sorted out, then sorted out again if you add more fish, etc. This stress reduces their immunity and can lead to death for no obvious reason. You're not doing anything wrong.