This study develops a dynamic, multi-product, multi-period, and multi-stage framework for a reconfigurable closed-loop supply chain in the dairy sector, with a strong emphasis on flexibility. The model effectively manages fluctuating demand by optimizing production, transportation, inventory, and queuing delays while considering warehouse queue lengths and constraints. A simulation-based optimization approach, integrated with response surface methodology, is employed to determine optimal resource capacities and batch sizes, enhancing the system's flexibility in terms of reconfigurability, resilience and responsiveness to market shifts. The results highlight a 13% improvement in new product development flexibility and a 30% increase in adaptability to consumer demand. Furthermore, the model demonstrates a reduction in unmet customer demand and orders by 37% and 25%, respectively, compared to the current system, underscoring its effectiveness in improving both supply chain performance and flexibility.