Through the years, Henry (Hank) Pym routinely suffered from periods of tension and depression. At the same time that the Avengers were undergoing turbulent roster changes, Hank felt that his scientific research had gone nowhere since his discovery of Pym Particles and was overwhelmed with guilt over his creation of the robotic villain Ultron. Hank also increasing experienced a sense of inadequacy compared to his wife, Janet, who besides being the principal means of support in the marriage due to her inheritance from her dead father, had also achieved considerable success in her own career as a fashion designer and had effectively eclipsed Pym's career as a superhero with her consistent service to the Avengers as the Wasp. Pym comparatively had numerous periods of retirement and inactivity.
In the midst of another breakdown, Pym began to be verbally abusive toward the Wasp while attempting to compensate for his perceived shortcomings through renewed service in the Avengers as Yellowjacket. Things came to a head on an Avengers mission when Yellowjacket blasted an enemy with whom Captain America was attempting to negotiate in the back. Feeling Pym's actions endangered the team and the public, Captain America—as the standing Avengers Chairman—brought court-martial charges against him. From there, Hank would make two of the worse decisions of his life. In a misguided effort to make himself look good at the court-martial hearing, the increasingly unstable Pym created a giant robot programmed to attack the Avengers that only he would know how to defeat. When Janet discovered his plan and confronted Hank, the now-deranged and misguided Pym violently struck her across the face and attempted to carry out the ruse anyway.
Not only was Yellowjacket's plan painfully transparent at the court-martial hearing, it also backfired. His robot is about to kill him before Janet stopped it. The irony of Pym's downfall coming at the hands of a robot of his own invention was not lost on the other Avengers who recalled the threat of Ultron and ruled against Pym.
Expelled from the Avengers, divorced from Janet, and penniless, Pym was manipulated by his old enemy Egghead into stealing a quantity of the unbreakable metal adamantium from a government facility by using his niece Trish Starr's life as a gambling chip. In the course of the robbery, the Mighty Avengers show up. Pym, desperate to save Trish, nearly defeats the Avengers (including Thor, Iron Man, and Captain America), before a confrontation with his ex-wife proves his undoing. Pym is unable to prove that Egghead forced him into the robbery, and is sent to prison on charges of treason. While incarcerated, Hank despairs even further upon seeing his ex-wife in the tabloids being romanced by teammate and lady killer Tony Stark (Iron Man).
When it comes time for Pym's trial, he is kidnapped (although it looks like a prearranged escape) by the Masters of Evil at the command of Egghead, who wants Pym to create a machine to grant him eternal life. Seeing no other options Pym agrees, and soon shows Egghead the finished device, inviting the criminal to try it out. The suspicious Egghead makes Pym use the machine first, just as Pym had anticipated. Pym had loaded the machine with weapons and methods to defeat the Masters of Evil, whom he summarily defeats. Pym decks Egghead, and turns to leave, to turn himself in to the authorities, when Egghead pulls out a gun. The just-arriving Avenger member Hawkeye the marksman fires an arrow into the gun, which backfires, saving Pym but killing Egghead.
Henry Pym is cleared of all charges thanks to the evidence in Egghead's lair, but refuses to return to the Avengers, stating that his superhero career had got him into this mess, cost him his marriage, and that he would never return to it.
Although Hank and Janet have since shared occasional romantic encounters, their relationship never recovered from these events and they remain apart. Of course, Hank could not maintain his vow to remove himself from super-hero life. Months later, Pym would begin work as tech support for the West Coast Avengers and eventually join their ranks.