Thin-walled aluminum alloy parts are widely used in the aerospace field because of their favorable characteristics that cater to various applications. However, they are easily deformed during milling, leading to a low pass rate of workpieces. On the basis of on-machine measurement (OMM) and surrogate stiffness models (SSMs), we developed an iterative optimization compensation method in this study to overcome the machining deformation of thin-walled parts. In the error compensation process, the time-varying factors of workpiece stiffness and the impact of prediction model errors were considered. First, we performed machining deformation simulation and information extraction on the key nodes of the machined surface, and an SSM containing the stiffness information of discrete nodes of each cutting layer was established. Subsequently, the machining errors were monitored through intermittent OMM to suppress the adverse impact of prediction model errors. Further, an interlayer correction coefficient was introduced in the compensation process to iteratively correct the prediction model error of each node in the SSM along the depth direction, and a correction coefficient between parts was introduced to realize the iterative correction of the prediction model for the same node position between different parts. Finally, the feasibility of the proposed method was verified through multiple sets of actual machining experiments on thin-walled parts with added pads.