Never having trained professionally in pastry (only in breadmaking), I've had my share of cookies and cakes go sideways from improperly creamed butter, sugar, and eggs. I think the issue for the home baker is that recipes always say after creaming the sugar into the butter, "Add your eggs one at a time, blending completely before proceeding," or something to that effect. The issue is, in a commercial bakery, if you add your eggs one at a time into a large bowl that is continously mixing, each incremental egg adds only a little liquid (e.g. a large batch of cookies might have 30 or 40 eggs). But at home, you might only be using a recipe that calls for two or four eggs -- meaning that each additional egg adds a lot of liquid (proportionally) that could potentially break the the butter's emulsion (butter is essentially air trapped in fat -- once that seal is broken, the butter goes oily and you end up with a greasy pastry).
My current at-home fix to this problem is to add a little of the flour I would ordinarily add at the end as I am blending in the eggs. After tossing in an egg (and if the solution ever looks like it is going to get kind of wet or liquidy), I toss in a quarter or eighth of a cup. This has worked out really well thus far. Let me know if it works for you at home.