The last time that I had goldfish, they too only lived for a few months, and I have no idea why, either.
I hope that you have much better luck with them next time, when you convert your betta tank at home.
Fish are enjoyable pets.
Love All Life, Thank You For Posting! :)