The U.S. economy faced an unexpected downturn in July, shedding 23,000 jobs despite expert forecasts predicting gains.