Sonic Theory: Metal Sonic's data-copying is derived from Gizoid technology.
I've long held the opinion that Metal Sonic's sudden advancements, transformation, and rebelliousness displayed in Sonic Heroes can be chalked up to Eggman incorporating Gizoid tech into him. Here's my reasoning:
1) Metal Sonic was at least present during the time that Eggman had Emerl. We know this because when Emerl first begins to speak, he refers to Sonic as "Metal", presumably confusing the two due to his still-developing mind. Blue hedgehog shape + Fast = Metal in his mind at that juncture.
2) Sonic Battle's prologue, where Eggman fails to gain control of Emerl due to his weak nerd noodle arms and discards him, or at least Eggman finding Emerl and beginning to study him, must happen before the start of Sonic Heroes. This is because Eggman's copies of Emerl, the E-121 Phi drones, bear a number and name that precedes Omega (Albeit that name is incorrect- Phi should be E-120, E-121 should be "Chi"). They have to have been built before Omega was.
3) If I recall correctly, Metal first displays the ability to copy data in Sonic Heroes, and before that his only copy-catting is through physical emulation of Sonic's speed and strength.
With this in mind, Eggman's access to the Gizoids predates Metal's rebellion and transformation into his Neo form (and the games do seem to treat it as a transformation, not a physical upgrade. I also doubt Eggman would design the transformation himself, he favours bigger, bulkier forms like Kai/Titan Metal). Eggman couldn't have built Omega and stationed him to guard Shadow while he was in the cell on the Final Fortress, so the rebellion must come later.
For the meat of the theory:
1) Eggman locates the Gizoid via Gerald's diary, stealing it from wherever GUN put it after they failed to get anything out of it themselves. His experiments with Gizoid technology then start with his attempts to control the original. These fail, as Eggman is not strong enough to form a Link with the Gizoid. The Gizoid then consumes Eggman's Chaos Emerald, and in a fit of rage, Eggman discards it from his base, leaving it to end up in the sea, where it drifts until the beginning of Sonic's episode of Sonic Battle.
2) Eggman then creates E-121 Phi, a near-exact replica of the Gizoid that doesn't have Gerald's pesky limiters on it. However, as he no longer has a Chaos Emerald, he is unable to bring Phi to life, rendering it even more inert than the real Gizoid. Frustrated, he decides to instead integrate the copy technology into a creation he has that already works: Metal Sonic.
3) Metal Sonic is upgraded with the Gizoid tech. At first, it works, and Metal displays the ability to copy technology and powers, storing the data of what he absorbs for his own use. However, Eggman has made a critical error- Without Gerald's failsafes, Metal does what the original Gizoid did before: He absorbs too much data, and is driven insane.
4) Metal's madness isn't as all-consuming as the Gizoid's- His experiences mean he had already developed a consciousness that the Gizoid lacked in its base state. However, his mind is warped by the overload, and he begins to believe that he is the real Sonic, and Sonic is the copy, despite his awareness that he was created to destroy Sonic. In his unhinged state, Metal finds himself free of Eggman's control, and locks up his creator, transforming into his Neo form (which is basically the equivalent of a Gizoid's Ultimate form). This is also when he becomes able to speak- He learned just like the Gizoid eventually will, but lacked the hardware needed to use this ability until he shapeshifted into a form with a voicebox.
5) Neo Metal Sonic concocts a plan to lure out the various teams of Sonic Heroes and copy their data into himself. He leaks the rumour about "Eggman's secret treasure" to attract Rouge to the hidden vault, freeing Shadow from his imprisonment. He then schemes to obtain the data of Perfect Chaos, by kidnapping Froggy and Chocola. This also draws Team Rose into the fray, allowing him to gain their data too. Using Gizoid tech would also explain why he didn't simply copy Shadow's data while he was in stasis- and keeps challenging the various teams with Eggman's mechs and robots: He has to actually witness them fighting to gain their data, just like the Gizoid does.
6) Neo Metal is defeated, and reverts to his base form before deactivating. Eggman reclaims him, but puts him on ice for a while.
7) The Gizoid washes up on Emerald Beach, and Sonic forms a Link with it, naming it Emerl after it absorbs another Chaos Emerald and begins copying him. Emerl begins to develop into a person.
8) Wanting Emerl back, Eggman decides to activate E-121. However, cautious of repeating Metal's rebellion, he places limits of his own on E-121, making it able to only mimic a single person, and not able to absorb more data. To make up for the loss of versatility, he builds multiple duplicates of the robot, making at least thirteen additional Phi robots.
9) In order to power them, he crushes the Chaos Emeralds he has access to into Shards. However, the Phi ultimately fail to capture their template, and are destroyed, with Tails fusing the Shards back together. Emerl absorbs all seven, and Shadow frees him from his destructive programming, only for Eggman to spitefully factory reset Emerl in an attempt to regain control, resulting in the near-destruction of Earth and Emerl's death.
10) Eggman uses data from Emerl and the E-121s to create Gemerl. As the Phi failed, he takes a risk of not restricting Gemerl's copy data again, instead closely monitoring its growth to halt it before it grows too strong. This too fails, as Gemerl is driven into Ultimate mode by the Chaos Emeralds, and after a repeat of Ultimate Emerl's rampage, is defeated and reclaimed by Tails.
11) In the wake of this, Eggman tries a different compromise. He reactivates Metal Sonic, but removes his ability to store data. Metal can now only copy people he is actively engaged with at the time, and loses these copied abilities afterward. This is why Metal can only use the abilities of his current opponent when he makes his return in Sonic Rivals and its sequel.
12) This too fails in the end. During Sonic Free Riders, Metal Sonic once again appears to be able to store data, and rebels against Eggman once more, taking all of the data he copied from the other racers for himself. Metal leaves at the end of this game, and his only appearances in main canon since that aren't prequels, time travel to CD, or illusions, are him being retroactively added to Sonic Colours by the port, and IDW. It's possible that Eggman captured and reprogrammed him again, or perhaps it's simply a different Metal.
13) Restoring Metal to his Neo form in IDW, which Eggman was retroactively doing during Sonic Forces, is a desperation move. Eggman was losing the war by that point, and figured potentially letting Neo Metal off the chain again was worth the risk. Ultimately, Neo Metal remains loyal this time, so perhaps Eggman was able to fix the problem at last, or maybe Neo Metal just didn't absorb enough data to go unstable again. After all, Gemerl did what he was told until he overloaded too (Personally I'd prefer it to be a balancing act, that using Neo Metal is a risk every time, rather than Eggman gaining perfect control, but that's largely irrelevant).
At the moment I think this holds up, and accounts for every canonical source that fits into the main series. That said, if I've missed something, feel free to point it out.












