Hi, what country are you in? Can you give us the name of the tank/filter please? Sadly, Bettas can go through a lot in their short lives and sometimes the damage is done to their gills/organs before we get them home.
Do not be too hard on yourself...you did your best and this is all part of...