It's probably not lactose, because she was OK and gaining weight well whilst you were breastfeeding, and breastmilk is very high in lactose.
More likely that she is now being exposed to more cows milk protein (which most formulae are based on) than she was when some of her milk was coming from you. And that is taking some getting used to. I wonder about using several "milks", rather than just one, so she's not getting a large dose of any particular soy/cow/goat/nut protein. Try her for a day on food-and-water and she if she's better or worse.