Poor kiddo, with all that extra grain in her diet it's no wonder she's got digestive issues. She is clearly having issues digesting it, so cut out the gluten and since she wasn't doing well with the formula, I'd cut dairy too. You can always add these things back in down the road, but you need to heal her gut so she can assimilate nutrients properly. Lots of whole foods - veggies, fruits in moderation (not fruit juice, it's just sugar without the fiber), and avoid white starchy potatoes as they will only feed bad bacteria in he gut. Coconut oil will be your friend - not only is it a healthy fat that be used for any cooking or baking, but it will also feed the good gut bacteria while killing off the bad.
Chia seeds are good for digestion, avocadoes and flax seeds for fat. If she will eat fish, salmon has a good fat ratio. Eggs are a great balance of proteins and fats. If she tolerates nuts, nut butters are another good one. Hummus is a healthy snack for kids that like to dip and very easy to make without all the preservatives.
Even if you just cut out the grains and increase the volume of everything else you should see a change. That said kids do sort of plateau weight wise for a bit. Mine has been stuck at 28lbs for something like 9mos, she's 2.