The Return of Optimus Prime (1) - S3-E29
Continuity mistake: At the end of the episode 'Dark Awakening', Optimus is seen without an eye and an arm, he also has other damaged points, but at the beginning of this episode, when Jessica and Gregory get to Optimus, he is in perfect condition with no damage.
Answer: This was actually one of many errors in Transformers, the Constructicons MUST have been built on Cybertron, the only transformers genuinely built on earth were the dinobots, reason being Vector Sigma has to give personalities to each and every robot, else they end up like the dinobots, very simple and dumb. For reference watch the episode "The Key to Vector Sigma" which introduces the Stunticons and Arielbots - both Megatron and Optimus Prime have to go to Vector Sigma to get decent personality traits installed, prior to this the new robots are controlled by remote controllers and have no AI.