Well, there is a positive and a negative side to it.
Negative is, if a store can't properly keep fish, then whenever you buy the sick/injured ones, it just opens up new room for other fish to become sick/injured. They have to keep everything stocked. So, ending the overall issue through this process will not work. It is actually going in the store's favor. Instead of throwing out the fish when it dies and they loose that profit, they still make money off of you.
Positive is, you are helping out a specific fish who more than likely would be doomed to death or pain. Although more will replace it at the store, at least you are helping one out to have a better life.
It's picking between two evils sort of a thing. I, personally, used to rescue bettas all the time. At one point I had thirteen tanks in my tiny little dorm for all of my rescue bettas. Most of them were far too gone for me to do much of anything and now I have three remaining from the original thirteen. I put in a lot of time, money, and a lot of love. It was actually more emotionally draining to walk back into the store and seeing five sick animals sitting where I had previously rescued one. I eventually sort of gave up. Every now and then I will pick one up, but I have gone through a lot of sad deaths and it makes me not want to get so attached.
It's up to you, of course. But, this is one thing to think about. Good luck though, if you do choose to go through with it <3