Not even a week after the Trump administration and Congress rekindled optimism that they could soon make progress on a pro-growth agenda including tax cuts, the unexpected firing of the head of FBI Director James Comey late Tuesday presented investors with a fresh reason to second-guess their confidence in the "Trump trade."

At the least, financial market participants viewed President Donald Trump's abrupt dismissal of Comey as an unwelcome distraction, while some fretted it could tie Washington in knots for months, potentially postponing already-delayed reforms.

The takeaway for the stock markets: don't bet on any quick legislation around trade, the budget, health care , or infrastructure.

"There is nothing good out of this for markets," said Michael Purves, chief global strategist at Weeden & Co. "It will weigh on Trump's ability to cut deals with Congress. It costs him negotiating leverage."

Jack Ablin, Chief Investment Officer at BMO Private Bank, said, "on a medium-term basis, it does undermine the administration's power to get things done."

Trump's election last November unleashed a powerful upswing in U.S. stock markets on the premise that he would cut taxes and regulation and usher through a major infrastructure spending package. The benchmark S&P 500 has gained 12 percent since Election Day, while shares of tech stocks and smaller companies have performed even better.

Nagging concerns about Trump's ability to get things done, along with some anxiety about stretched equity valuations, have combined to cap the rally, and stocks have done little since early March.

Around midday Wednesday, the S&P was near unchanged, as were other market benchmarks.

The administration recovered some credibility last week when the House of Representatives voted to repeal major portions of former President Barack Obama's Affordable Care Act after failing to do so a month earlier. The simple achievement of advancing the healthcare bill to the Senate had been seen by investors as a signal that enacting tax cuts was doable, the big question was just how soon - this year or next.