Something to keep in mind is that we have no idea where the pet store bettas come from or the conditions they are bred and raised in. You may have done everything right, and still may not have been able to save her. But you did give her a warm, secure, and healthy home that she may not have had otherwise.
Sometimes, something as simple as a bit of cleaner, hairspray, perfume, deoderizer, etc. can float into the water and that's all it takes. Sometimes it's a heater spike. Sometimes, we never know.
I've been in your situation and I agree that it 100% sucks. But the fact that you did your best means a lot.