Hello there. Freezing baked pasta dishes is one of the most convenient meal prep strategies, but pasta can indeed become soft and mushy if it undergoes a full cooking cycle twice.
To achieve the best texture, you should combine two adjustments: significantly undercooking the pasta and freezing the casserole unbaked.
First, boil your ziti for about two to three minutes less than the minimum al dente time listed on the package. The noodles should still have a firm, slightly chalky bite in the center. After draining, rinse them briefly with cool water to halt the cooking process and stop residual steam from softening them further before assembly.
Second, assemble your casserole with your sauce, cheeses, and seasonings, but do not bake it before freezing. When you bake a casserole before freezing and then reheat it later in the oven, the pasta starches are heated twice in excess liquid, which breaks down their structural integrity and causes that soggy consistency. Freezing it unbaked ensures the pasta cooks through only once when you are ready to eat it.
Third, allow all ingredients to cool completely before sealing and placing them into the freezer. If you seal warm food, trapped steam creates condensation and large ice crystals, which also damage the texture of the noodles.
When it comes time to cook, the gentlest method is to transfer a portion to the refrigerator the night before to thaw. Once thawed, bake it covered with foil at 350 degrees Fahrenheit (175 degrees Celsius) for about twenty to twenty-five minutes, then uncover for the final ten minutes so the cheese bubbles and browns nicely. If baking directly from frozen, keep it tightly covered and extend the baking time accordingly.
I hope this helps your next batch turn out perfectly firm and delicious.