What’s the most expensive mistake you’ve ever made?

In 1999, NASA crashed a spacecraft into Mars because one of its teams had used English units (feet and pounds), while another used metric units for a key calculation (total damage: $327.6 million).

In 2005, a trader at Tokyo’s stock exchange meant sell one share of J-Com Co. for ¥610,000 (about $5,000), but accidentally sold 610,000 shares for ¥1, a $225 million typo.

And in 2015 filming of the Quentin Tarantino film The Hateful Eight, Kurt Russell destroyed a priceless, 150-year-old guitar on loan from a museum that had been meant to be replaced with a double, prompting a look of utter, and entirely genuine, shock from actress Jennifer Jason Leigh that made the movie’s final cut.

Now Congress is making a strong play to be included in this ignominious list thanks to a massive loophole included in the recent tax reform bill.

The change, which has been dubbed the “Grain Glitch” because it provides ludicrously generous tax benefits for agricultural cooperatives, is already prompting a kind of legal filing gold rush as companies race to establish legal entities eligible for the windfall.

According to Reuters, “lawmakers have admitted they made a mistake by including the clause in last-minute changes to the bill.”

“I think at the end of the day what it boiled down to is the staff didn’t know what they were doing. … They rushed this thing through,” Rep. Collin Peterson (D-MN), the ranking Democrat on the House Agriculture Committee, said to the Associated Press.

Oops.

The key to understanding the loophole is the difference between net income and gross income. Net income is profit: revenue minus expenses. Gross income is just revenue, regardless of cost.

Under the new tax reform law, households are permitted to deduct 20 percent of their net income from a small business.

The same provision was also extended to cooperatives, a special type of business run for the benefit of its members, except it applies to 20 percent of gross income.

Since you are only taxed on net income in the first place, this deduction could swallow the entire tax liability for many farmers.

The Tax Foundation’s Scott Greenberg provides the following example: a farmer who sold $2 million worth of grain to a coop, with costs of $1.6 million, would have a net income of $400k, but could deduct 20 percent of $2 million, or $400k, thereby paying zero taxes.

The law has plunged the private crop handling industry into uncertainty, with many firms opting to spend hundreds of thousands of dollars on legal fees to quickly establish cooperatives of their own.

This is, first and foremost, a giant waste of money and energy, all for a legislative accident that has no economic justification whatsoever.

But surprise, surprise: lobbyists for the cooperatives are working overtime to protect their windfall. The coops are “enthusiastic about maintaining it,” Zach Clark of the National Farmers Union told Forbes’ Peter Reilly.

Negotiations over a fix “are going nowhere,” Teresa Castanias, an accountant in Dixon, CA whose idea it was to include the special treatment for cooperatives, told Reilly.

“Everything they try hurts someone,” she added. (If the government accidentally gave me $1 million, it would hurt a lot when they took it back.)

Meanwhile, private companies that compete against cooperatives are weighing whether 1) form a cooperative, or 2) go bankrupt, all because a congressional staffer was sleep deprived.

Mike Erker, the president of one such company in Fort Morgan, CO, was incredulous that Congress could be this stupid.

“I can’t believe these public servants wrote that,” Erker said. “When we looked at that we kind of chuckled. Aren’t these people smarter than that? How did they even think of such a thing. I’m totally amazed at the lack of thought process that went into something like that,” he told the Fort Morgan Times.

It may be comical from afar, but it sure isn’t when your livelihood is at stake. This isn’t right, and Congress needs to fix it. Months have passed since Congress upended an industry through a careless provision in a long bill. It’s well past time for them to fix the problem.