Actually, weight loss is a side effect of metformin because of what it does to your stomach. What you can do is to try eating something beforehand so as to not upset your stomach after taking the medication.
Usually, these side effects go away as soon as your body gets used to the medication. However, since you have IBS, it may need a llittle more time to get used to. Well, at least, you get to lose a bit of weight while your body adjusts to metformin.
Hope this helps.