Young children with acute diarrhoea, typically due to infectious gastroenteritis, may temporarily stop producing lactase, the intestinal enzyme that digests lactose. This means they may not digest lactose, the main sugar in milk, and this may worsen or prolong the diarrhoeal illness. However, there is uncertainty whether avoiding lactose-containing milk or milk products helps young children recover from acute diarrhoea more quickly.
MacGillivray, S., Fahey, T., & McGuire, W. (2013). Lactose avoidance for young children with acute diarrhoea. Cochrane Database of Systematic Reviews, (10), [CD005433]. https://doi.org/10.1002/14651858.CD005433.pub2