But it can have hurtful, shameful, and dangerous consequences. Breast milk is usually best, but not always. In this case, adherence to this mentality nearly killed your boy and formula is life-saving. I say this not to criticize but to hopefully relieve the "shame" that many parents feel when they aren't following "breast is best". Please don't feel any guilt when you bottle feed with formula, and you don't owe anyone an explanation when you whip out that bottle in public spaces and get glaring eyes from other couples. Your hardest challenge may be helping your wife not feel like a failure when she continues to formula feed. I had 2 kids with very similar experiences to you (formula was literally lifesaving) and my wife expressed these shameful feelings when she couldn't continue to breastfeed. (E.g. she was told to leave the mothers room at church because it was for "breast feeding mothers" only).
Hopefully it works out by cutting the dairy, but be mentally prepared to continue with formula if /when it doesn't. Breast is best, except for the times when its not the best.