I will add an anecdote that from observation, two people on the same diet over long periods can have significantly different poop frequencies, and differing regularity.
YMMV. It's not just determined by the food intakes, there are individual factors.
At a guess, these individual factors start with 1) genetic component to reactions to substances such as lactose and to caffeine. 2) Gut microbiome.
In other words, saying "change diet and you can change the poop schedule" is true, but "with this diet you will definitely get this schedule" is not.