Topiramate is approved for and used in the treatment of epilepsy and certain other seizures. It is neither approved nor recommended for reducing weight.
It has many side effects and one of them is weight loss. But it can also cause: memory and learning problems, difficulty in concentration, confusion, speech problems etc.
Curiously topiramate itself can cause psychiatric disturbances.
Using any medicine for its side effect, rather than effect, is a controversial issue.