I had a friend who had a crowntail betta that did the same thing right before he died. She had him for five months and he was the most active fish that I have ever seen he would swim around his tank all day long and play with my friend's finger when she would wiggle it on the tank window. One day he just stopped moving and sat in the top corner of his tank. Her and I researched every disease imaginable but to no avail. We just could not figure out what was wrong with him. He appeared healthy but he stopped eating. We checked for Ich and swim bladder and tried some medications but he died anyway. I don't think your fish dying was anything you did wrong. Sometimes it's just their time to go and buying from a petstore you don't really know how old the fish is to begin with or how they were treated before you purchased them. I'm sorry I don't have any good advice to give but as far as I can see you do the same thing I do with my fish and I've had sixteen of them for nearly a year and a half.