Lyophilizing can sometimes be like magic; the more you practice, the better the outcome. The outcome of a freeze dried product can range from a nice cake to a collapsed lump in the tube.
By understanding the freeze dry process, you can get a great result each and every time.
This White Paper, "Why, What And How? Understanding The Freeze Drying Process" is a great study guide for boning up on your Freeze Dry Fundamentals.