Bonuses for AIG employees? News this weekend that troubled insurer AIG, after receiving over $170 billion in taxpayer funds to prop itself up, is planning to pay some $1.2 billion in bonuses and retention payments met with general outrage from the average man in the street to the man in the White House. Now comes word that President Obama has called on Treasury Secretary Timothy Geithner to pursue “every legal avenue” to block the payments.

That may be easier said than done. Like most other issues in the massive Gordian mess of the financial world, this problem is not as simple as it seems. Despite the focus on high-flying executives, most of the recipients seem to have been mid-level employees. And some apparently were folks who were brought in to help clean up the Augean residue within AIG, exactly the sort of folks you’d want to compensate.

That doesn’t explain all the bonuses however. Seven individuals reportedly received more than $3 million. And while it’s impossible to delve into the merits of each, there’s little sense that AIG engaged in the sort of cutbacks one would expect of a firm losing billions — and supported by billions — in taxpayer funds.

But there’s another problem: AIG maintains that many – perhaps most – of the bonuses were required by contract, and thus AIG had no choice but to pay them out. That presents a bit of a legal and constitutional barrier to efforts by Geithner to block payments. And unless Geithner finds sound legal grounds for challenge, the precedent created by government efforts to break contracts could be an ugly one.

This conundrum illustrates the problems inherent in ad hoc taxpayer bailouts such as that provided to AIG. In the normal course of events, failing firms end up in bankruptcy court, where pre-existing contracts and debts can be reduced or eliminated, under the (non-political) supervision of a court. That’s the option recommended by my colleague Andrew Grossman last week for General Motors and Chrysler, which are groaning under the weight of their own labor contracts.

The AIG situation, of course, is in many ways different. The stated rationale of the bailout has been to ensure that AIG could honor its financial commitments – thus avoiding cascading instability in the financial system. Regardless of whether you agree with the rationale, bankruptcy undercuts that assurance.

The result is unsatisfactory – with AIG functionally bankrupt, but without the ability or incentive provided by bankruptcy to reduce its costs. And the difference is unhappily covered by the taxpayer.

The situation underscores the distortions and unexpected consequences which accompany any kind of financial “rescue” plan, especially an ad hoc one such as AIG’s. These costs must be considered before policymakers again press the bailout button.