Build a custard, not scrambled egg
Egg supplies the protein network and milk or cream dilutes it for tenderness. Too much egg or excessive heat creates a firm, rubbery filling. Use a tested ratio, mix without whipping in excessive air and season the liquid before it goes into the crust or dish.
Remove water from fillings
Cook mushrooms, spinach, courgette and other wet ingredients first, then cool them. Drain watery cheese and avoid crowding the custard. For pastry, blind-baking according to the recipe helps protect the base from the wet filling.
Stop at a gentle wobble
Bake at moderate heat until the edges are set and the centre has a small, unified wobble rather than a liquid wave. Carry-over heat completes the set. Resting before cutting also lets the protein network settle and hold a cleaner slice.