Did you bend back the derailleur or the hanger? Normally you bend the hanger if there's some bent, not the derailleur. Unless your derailleur actually got bent. Also there is a difference between a misalignment caused by bent hanger or simply the derailleur needing adjustment of the limit screws and cable tension. Before bending the derailleur you should first check the hanger alignment with a hanger tool, then set the limit screws and cable tension, and then if necessary bend the derailleur.
And when you say the chain falls off when on the largest 2 cogs, that doesn't explain how it falls off. Does it fall off at the front on the chainrings, or does it not fall but slips at the rear outward to a smaller cog?