There was less liquid in it than the recipe assumed
CommonA dough comes together when there is enough liquid to hydrate the flour and enough worked fat or egg to bind what is left. Three common things reduce the liquid without anybody noticing. Flour measured in cups varies enormously with how it was scooped, and a heavy cup can add a substantial fraction more flour than intended. Wholemeal and other high-bran flours absorb more water than white for the same weight. And eggs are sold in size bands rather than at a fixed weight, so a recipe balanced on a large egg is short of liquid with a medium one. The result is the same in each case: a mixture that stays as crumbs however long it is worked.
What to change
Weigh the flour, then bring it together with very little liquid
Weigh the flour rather than measuring it by volume, and check whether the recipe assumed a large egg. To rescue a dough that is already crumbly, add liquid a teaspoon at a time and stop the moment it coheres — milk or egg rather than water in a rich dough, because both bring fat or protein that will help bind it. Work it as little as possible after the liquid goes in.
Biscuit, shortbread, gingerbread and pastry doughs that will not come together. In a bread dough the same diagnosis applies and the correction is larger, because a lean dough tolerates and needs far more water.
Trade-off: Extra liquid in a short dough encourages gluten development, so a rescued dough is usually a little tougher than one that was right to begin with.