401k © Tom Grill, Corbis

Wall Street has a special talent for duping Main Street investors. It pushed buy-and-hold ahead of the worst decadelong performance in stocks since the Great Depression. It pushed the dot-com bubble. It pushed buy-and-flip housing.

The latest involves investors' post-recession obsession with bonds.

Everyday investors went looking for something safe and steady after two stock market blowups, so they loaded up their 401k and IRA accounts with bonds. After the financial crisis passed, billions flowed into the corporate bond market, and stocks were largely ignored.

While we can't be precise about all those moves, one measure shows that since the recession, $1 trillion has flowed into taxable bond mutual funds -- while similar stock funds lost nearly $400 billion. That and other data suggest a major shift in our retirement portfolios from stocks to bonds.

Why did we move? Because brokers, advisers and experts promised that we could escape worries about market ups and downs. That we'd get safe, steady income without trading or turmoil. That we could collect regular yield payments and simply enjoy life.

Unfortunately, that's not true. When the bond market goes bad, bonds carry risks, just as stocks do. And right now, bonds are in trouble, as Apple's (AAPL) recent bond mess shows. Here's why, along with some advice to help you get your 401k out of the way before the wipeout.

The sour Apple bonds story

Bonds are like marriages: They're easy to get into, but difficult to leave. When the economy revs up, you're locked in and miss out on bigger gains in stocks. If the economy falters, you face higher risks while settling for Treasury-like returns. When inflation kicks higher, your returns -- the yield payments from bonds -- don't go up with it.

And when bond prices drop, as they are doing now, you either sell at a loss or settle for a low return. And that's where we are in the bond bubble.

A key turning point, and a great illustration of the problem, is the $17 billion bond issue floated by Apple in late April, the largest nonbank debt deal ever.

The writing was on the wall, even if few noticed. The stock had peaked in September and had since fallen 45% to reach its mid-April low. The company had just posted its first drop in quarterly earnings in a decade. Apple's bonds didn't attract the coveted AAA rating from the credit agencies. And management was explicit that the cash wouldn't be used to fund exciting new products and innovations; it would be used instead to help return cash to shareholders.

Still, at the time, Wall Street told us that investors were rushing to get in on the deal, claims that now sound like the hype that preceded the disastrous Facebook (FB) IPO. The offering attracted more than $50 billion in orders, with the bonds ultimately pricing at a yield -- or rate of return -- of just 3.85% for the 30-year notes. Yields fell even lower in the secondary market once the bonds started trading, as prices climbed.

Now consider that, since 1962, the 10-year U.S. Treasury bond has yielded 3.85% or less just 11% of the time. So the Apple bonds paid investors far less than T-bills on average and locked their money up three times longer.

That's not a good deal.

In the weeks that followed, overall interest rates have increased as market volatility has picked up. Some of this is due to turmoil in Japan. Some of it is due to fears that the Federal Reserve could slowly reduce its $85 billion-a-month bond purchase stimulus. And some of it is due to a rerating of corporate default risk by investors looking at a darkening macroeconomic and earnings outlook.

As a result, the price of Apple's bonds maturing in 2043 dropped, peak-to-trough, 11.4% to a new low last week. That does bring the yield up. And if yields keep rising, due to higher interest rates and/or more concerns about default risks, prices will keep falling, because of the inverse relationship between bond price and yield.

But consider what this really means. Apple bondholders can't sell their bonds without taking big losses. But if they don't sell, they're stuck with relatively low returns for 30 years. Like a bad marriage.

While bond buyers got hosed, the company and its shareholders made out: If Apple floated its bond offering now, it would have to pay buyers an additional $400 million annually over the next 30 years, according to calculations by Bloomberg News.

And what about the traditional argument in favor of bonds: that if you plan to hold a bond to maturity in 2043, none of these fluctuations matter?

Well, since 1871, 10-year Treasury bonds have averaged a 4.7% return. With these Apple bonds, at best, you're earning 20% less than that every year for three decades.

The great bond mistake

The story of these Apple bonds illustrates the wider problem: investors, in their feverish desire for safety and income, have been overpaying for bonds that don't offer enough return to compensate them for the risks inherent in fixed-income investments.

Inflation alone has averaged 2.3% since 1871, so those 3.85% Apple bonds were set to provide a real, after-inflation return of only 1.6% a year. That might have seemed attractive a month after the housing bust and stock collapse. But with stocks up more than 100% from their bottom, it probably doesn't right now.

And if you're looking at funding a retirement, I bet you want more than 1.6% a year from the money you've put in your 401k or IRA.

Consider the valuations of the entire corporate bond market. According to data on speculative corporate bonds from Standard & Poor's, non-investment grade issues are carrying default rates 140% higher than they were at the 2007 market top (2.4% vs. 1%) while yields are at 6.3%, and were just 5.2% a few weeks ago, versus 9.3% then.

The simple translation: People are carrying more risk (from both default and inflation), but they aren't being compensated for it, because higher bond prices lowered yields. That's the very definition of an overpriced asset.

Image: Anthony Mirhaydari - MSN Money

Anthony Mirhaydari

And now, bond investors are getting reacquainted with market risk as well -- the chance that, if you decide to sell your bond holdings before maturity, the market will have moved against you and you'll have to sell at a loss.

Funds that invest in higher-yielding but riskier bonds, like the Barclays SPDR High Yield Bond (JNK) and iShares iBoxx $ High Yield Corporate Bond (HYG) exchange-traded funds, have lost more than 3% of their value since early May, or roughly six months' worth of the income they generate.

The damage has been deeper in the safer investment-grade class of bonds: The iShares iBoxx $ Investment Grade Corporate Bond (LQD) fund has lost 4.5% in the past month and a half, wiping out 15 months' worth of yield income. That's dead money. It just sits there.

And sadly, such funds are where investors scared by the crash seem to have gone. According to Investment Company Institute fund-flow data, for example, investors have poured nearly $1 trillion into taxable bond funds since the bear market ended in March 2009. Compare that with a $382 billion net withdrawal from domestic stocks over the same period.