Gennerally swimming/balance issues are related to swim bladder problems. Usually this is the symptom of something else such as internal parasites/worms, some form of infection or constipation. The latter is often the most common cause. Diagnosing this is easy- the fish will not be pooping and eventually will bloat up and stop eating.
Diagnosing internal parasites can normally be done because it will cause stringy and white colored poop. Worms are harder as usually there are usually no visable signs except for Camallanus where you will see them hanging out the anus.
Bacterial infections are often not in the swim bladder. Instead they are nearby which can cause internal swelling which then puts pressure on the bladder.
As you can see, diagnosing can be an issue. And this is all complicated by such problems being caused by brain damage usually caused by a startled fish bolting head first into the glass. Unless you witness this, you would have little way to know it happened. Unfortunately, I had this happen with a lovely discus. It spent the final half year of its life in its own tank living facing down as it could not right itself. If you betta is in with other fish I would suggest moving it to an H tank so there is no danger of other fish going after it. This will just stress her and that, in turn, will further weaken her immune system.