Substituting ghee for butter in a baked recipe rarely gives the expected result. The two are not the same fat with different flavours, and the difference sits in what butter contains besides fat.
What clarifying removes
Butter is roughly four-fifths fat, with the remainder water and milk solids. Making ghee simmers off the water and strains out the solids, leaving nearly pure butterfat.
That missing water is significant in baking, where it becomes steam and contributes to lift in laminated and creamed doughs.
A recipe that swaps in ghee measure for measure therefore loses liquid it was relying on, and the dough behaves drier than intended.
Why creaming does not work the same way
Creaming butter with sugar works by dragging air into a solid fat that holds the bubbles in place. Butter is solid and plastic at room temperature, which makes this possible.
Ghee is grainy or liquid depending on temperature and does not hold an aerated structure in the same way. Whipping it produces far less volume.
Cakes built on creaming as their leavening therefore come out denser, and the fault is structural rather than a matter of technique.
How each fat coats flour
Fat limits gluten development by coating flour proteins so they cannot link freely. A liquid fat coats more thoroughly and more evenly than a solid one worked in as pieces.
That makes ghee excellent for short, crumbly textures, which is why it appears throughout Indian shortbread-style sweets and fried doughs.
It makes it poor for anything wanting distinct layers, since layering depends on solid fat staying in sheets between sheets of dough.
What ghee contributes to flavour
The milk solids browned during clarification create aroma compounds that survive into the finished fat, so ghee carries a cooked, nutty character butter does not.
Because it is nearly all fat, that flavour is also more concentrated per spoonful than butter's, and it comes through more strongly in a plain dough.
It is stable in storage for the same reason, since the water and solids that let butter spoil have been taken out.
How to make the substitution work
Using slightly less ghee than the butter called for, and adding a little liquid to replace the missing water, brings the hydration back into range.
Recipes built for oil convert to ghee far more easily than recipes built for creamed butter, since they never depended on solid fat holding air.
Traditional Indian baking largely developed around ghee rather than butter, which is why those recipes do not need adjusting and produce the textures they were designed for.