The stock market had another good day on Wednesday, with the Nasdaq Composite (^IXIC -0.52%) moving higher by more than 1% as of 1:30 p.m. ET. Market participants pointed generally to an inevitable recovery from 2022's poor performance, and they also expressed confidence that the latest numbers on inflation that the Bureau of Labor Statistics will release Thursday morning will continue the trend of easing price pressures.

When you look at the best performers on the day, however, you'll notice a lot of familiar names of companies that have been having considerable financial trouble. Among those high-flying stocks are Bed Bath & Beyond (BBBY) and Carvana (CVNA 2.88%), which have faced major headwinds that have posed existential threats to their ongoing businesses. Even though shareholders in these companies are seeing amazing results on Wednesday, the gains are coming largely from a phenomenon that's purely short term in nature and could reverse itself at any moment.

What's happening with these two stocks?

The thing that Bed Bath & Beyond and Carvana have in common is that they have had a lot of investors questioning whether they can stay in business. Bed Bath & Beyond announced just yesterday that its revenue had fallen sharply in the holiday quarter, raising new concerns about its ability to stay afloat amid rising pressure to get back on a growth trajectory. Indeed, with less than a month to go before needing to make a sizable interest payment on a portion of its debt, the home goods retailer has a lot of investors believing that it won't be able to keep operating without getting some form of protection or relief from its creditors.

Carvana is also struggling with its debt, as rising interest rates boost its financing costs even as falling used car prices weigh on its fundamentals. The car dealer still has a couple of years before some of its longer-term debt needs refinancing, but with economic conditions worsening, shareholders seem more skeptical about Carvana's future prospects than ever.

Yet on Wednesday, traders couldn't get enough of the two companies' stocks. Bed Bath & Beyond shares jumped 44% at midafternoon on Wall Street, while Carvana settled for a 23% rise.

Short squeeze value traps

The main issue with these stocks is that they've gotten hit hard over the past year, and that has attracted considerable interest from short-selling investors. Bed Bath & Beyond had 57% of its float and 32% of its outstanding shares sold short as of mid-December, according to figures from Yahoo! Finance. Carvana's short interest was even more extreme, with 80% of its float and nearly half of its outstanding shares used for short-selling.

When there's so much negativity about a stock, it becomes extremely attractive to those who want to bet against it. However, the mechanics of short-selling leave investors vulnerable to those who choose not to make their shares available for borrowing. Combine that with limited numbers of outstanding shares in the first place, and short-sellers can find themselves having to pay much higher prices in order to return the shares they borrowed. That's known as a short squeeze.

Short squeezes can lead to massive gains that are far greater than what either Carvana or Bed Bath & Beyond has seen thus far. However, at some point, those holding out for gains finally start to cash in their positions, easing up pressure and causing the short squeeze to stop. Often, that results in the stock falling back downward and erasing recent gains.

Don't fall for FOMO with subpar stocks

There are plenty of stocks that have seen significant declines over the past year that still do have good fundamental business prospects. In that case, bargain hunting can be a smart long-term strategy.

With many short squeeze stocks, however, bullish scenarios simply aren't realistic. If you see a stock jumping on a day like today for no apparent reason, ask yourself if there's a short squeeze going on -- and then remind yourself that you likely lost conviction in that stock's ability to reverse its losses a long time ago.