Ahh don't give up! I would say transitioning fish from the store to your home for the first 3-6 months is quite hard, but if you are successful then your fish should live a long time with care.
If you aren't successful multiple attempts might be needed before you are successful, it’s just part of mastering that particular species in my opinion. Besides you can always breed more once you get the hang of it.
Your tank seems to be doing fine as all the other fish are surviving, it may just be the guppies themselves. You can go back to the store and see how the rest of their stock have fared. Guppies tend to move from arrival to the store to someone's home sold quite quickly, so if a batch is bad or the weaker individuals have not been sorted out you may end up with them. Just an idea, but your local fish club may also be a good source of locally sourced guppies which would be hardier as well.
For some reason in my fish room new guppies have a high chance of crashing within a couple of months, like yours they tend to do fine for a little bit, but end up shimmying and refusing food. It seems to happen to everyone, Stan Shubel was a famous guppy breeder who passed away a few years ago had individual guppies that would occasionally stop eating and start shimmying and that behavior would spread to the other fish. His solution was to stop feeding and also isolate the individuals before it affected the colonies. As for tail rot, he thought it stemmed from too much food being put into the aquarium increasing the likeliness of a bacterial infection. For me sometimes increasing the hardness of the water with shrimp minerals helps and they recover, but it doesn't always work. Regardless my workaround has been to breed them quickly as the babies will be much hardier and more conditioned to your water than the parents, so if I lose the parents the colony will survive!