Tissue scaffolds have emerged as a promising solution for treatment of critical size bone defects, offering significant advantages over conventional strategies. One of the key functionalities of bone scaffolds is their ability to promote long-term bone ingrowth effectively. To enhance this functionality, we develop a novel dynamic optimisation framework to customise bone scaffolds for achieving maximum bone ingrowth outcomes over a certain period in this study. To improve the design efficiency, we extensively leverage machine learning (ML) techniques within our proposed dynamic optimisation framework. Specifically, two neural networks are integrated into a dynamic bone growth model, and another neural network is coupled with a genetic algorithm for dynamic optimisation process. To demonstrate the effectiveness and efficiency of the approach, we employ a sheep mandible reconstruction for treating a critical size bone defect as an illustraive example. To validate the finite element (FE) model established, we first conduct a mechanical test on the sheep mandible assembled with a tailored 3D printed scaffold made of Polyetherketone (PEK) material. Then, we compare three different optimisation schemes, namely uniform design, lateral gradient design, and vertical gradient design, with an empirical design under the same biomechanical conditions. A 18.5 % enhancement is found in the long-term bone ingrowth when the optimised scaffold is adopted in comparison with the empirical design, which is attributed to the fine-tuning of strut sizes within lattice scaffold structures for facilitating bone regeneration in the gradient regions. This study proposes a novel design framework by combining ML and time-dependent topology optimisation, which provides a new methodology for developing innovative tissue scaffolds with better clinical outcomes.