You might consider this. Lactose intolerance and the breastfed baby
Lactose is the sugar in all mammalian milks. It is produced in the breast and is independent of the mother's consumption of lactose. It is present in a constant concentration in breastmilk.
Primary (or true) lactose intolerance is an extremely rare genetic condition and is incompatible with normal life without medical intervention. A truly lactose intolerant baby would fail to thrive from birth (ie not even start to gain weight), and show obvious symptoms of malabsorption and dehydration - a medical emergency case needing a special diet from soon after birth.
Anything that damages the gut lining, even subtly, can cause secondary lactose intolerance. The enzyme lactase is produced in the very tips of folds of the intestine, and anything that causes damage to the gut may wipe off these tips and reduce the enzyme production, for example.
And yes, you are correct that there are other conditions, e.g. intestinal inflammation, etc. which can reduce the presence of this enzyme, causing temporary or permanent lactose intolerance. But the point is that the normal presence of the enzyme into adulthood is an adaptive mutation. Diseases or conditions which can strip this advantage are interesting but beside the point.