Guy makes something they thought would benefit the world, lives to regret it
Flint Lockwood (Cloudy With a Chance of Meatballs), made a device that generates food from water (it goes haywire)
Alfred Nobel (Real Life), made dynamite as a safe way to use explosives (it was used in war)
Oppenheimer (Real Life), thought the bomb would stop the war, it did (but not without several thousand casualties)