Is Wall Street right to worry that President Donald Trump’s drubbing on health care means big trouble for tax cuts? Judging by the market’s reaction lately to bad tidings on the health bill, the financial community frets that its defeat will endanger what it really cares about most: taxes.

But a number of market observers caution that the stumble on health legislation does not necessarily spell doom for Mr. Trump’s economic stimulus agenda, which also includes a $1 trillion program to fix ailing infrastructure. The reason: To lawmakers, tax cuts and, to a lesser extent, pork-barrel public works projects are like big chocolate cakes with extra frosting. Repealing and replacing Obamacare, which risks harming some of their constituents, is a dung heap in comparison.

“Health care is a temporary setback that won’t have a nefarious effect on tax cuts, which is like handing out candy,” said John Maloney, head of New York’s M&R Capital Management. The failure to pass an Obamacare overhaul, he noted, could hurt stocks “but the impact will be short-lived.”

Get Breaking News Delivered to Your Inbox

For the market, the health care bill’s failure “will matter in the short term,” said Brent Schutte, chief strategist at Northwestern Mutual Wealth Management. “But not in the long term. The market wants health care out of the way.”

The White House made clear it intends to pivot to taxes. “Now we’re going for tax reform, which I’ve always liked,” Mr. Trump said in the wake of the health bill’s getting pulled Friday, before a certain defeat in the House of Representatives.

No one believes that tax cuts will be easy to do -- the tax code is an intricate mosaic of special subsidies and loopholes supported by powerful interest groups and their savvy, hard-charging lobbyists.

But what if the health impasse demonstrates an inability of the president and his party’s legislative leadership to get things done? Investment firm FBR’s baleful take in a research note was that the defeat diminishes the chances of a tax cut and raises “serious questions about the ability of congressional Republicans to effectively govern and achieve their agenda.”

“Yes, this does make tax reform more difficult, but not impossible,” said House Speaker Paul Ryan, a Wisconsin Republican, referring to the health bill’s demise. In what turned out to be a strategic error, Ryan wanted to pass an Obamacare substitute first before tackling taxes.

Wall Street in general has shrunk its expectations for the Trump tax cuts. A recent Bank of America Merrill Lynch survey of fund managers found that just 10 percent of them thought a tax bill could be passed before the August congressional recess, the administration’s target.

Since Election Day until recently, excitement over the Trump administration’s stimulus plans has helped power the market to strong gains, up 10 percent, although the rally actually started earlier in 2016. On the run-up to the health vote, though, the market got choppy. Last Tuesday, worries about the Trump economic agenda’s stalling were a strong influence in pushing the S&P 500 to a 1.2 percent loss, the worst slide in five months. Then on Friday, as the health bill crashed and burned, the market swung back and forth, to finish down 1.4 percent for the week, its worst weekly showing since the week before the election.

The House health bill, known as the American Health Care Act, aimed to rescind the taxes created by Obamacare, cancel a penalty against those who do not buy coverage, lower funding for the Medicaid program for the poor and disabled, and reduce tax subsidies that help individuals buy plans.

The current template for tax cuts, crafted by Speaker Ryan, calls for sweeping reductions in rates for businesses and individuals -- paring personal income tax brackets to three from seven, and the top individual rate to 33 percent from 39.6 percent, while trimming the top corporate rate to 20 percent from 35 percent. Mr. Trump has a slightly different version, which would decrease the highest corporate rate to 15 percent, for instance.

Both the president and Ryan want to entice the estimated $2 trillion in U.S. corporate cash stashed in low-tax locales overseas to return home. The Ryan framework also seeks to slap a 20 percent levy on imports and not tax exports at all, called a border adjustment tax. This has generated a lot of skepticism, especially from Mr. Trump.

Both the president and the speaker want to bring an enormous infusion of capital into the U.S. economy, so people and companies spend and invest more, and that has gotten Wall Street salivating. By the same token, Mr. Trump wants to spend some $1 trillion on restoring decrepit roads, bridges, tunnels and the like, which he believes will be an adrenaline shot for economic growth.

Here’s are three key things investors should know about what the health bill’s reversal could mean for taxes and infrastructure:

Gridlock remains an impediment. At first blush, divisions over health care in Congress seem to illustrate irreparable divisions, with intransigent Democrats and squabbling Republicans, who control both chambers, unable to agree. Would that standoff recur with other legislation, and dash Wall Street hopes for economic stimulus?

Treasury Secretary Steven Mnuchin said on Friday that the administration wants to get a tax plan passed before Congress’ August recess. That is a tall order: The last major tax revamp, in 1986, took more than a year to enact. “History reminds us that it has been decades since significant tax reform has passed in Washington, because it is not easy,” said Bankrate.com’s senior economic analyst, Mark Hamrick.

Goodies are popular, but the larger question is how to pay for it all. The border tax is supposed to raise some $100 billion yearly, which would be a big help. But such a tax could end up hiking prices for goods and services in the U.S. and harm American retailers, who depend on buying many of their wares overseas. So this feature is sure to be a snag in congressional negotiations.

Trump is versed in the art of the comeback. That was the name of one of Mr. Trump’s books, detailing how he turned around his sorry lot after his real estate empire almost collapsed in the early 1990s. He has an intense competitive streak and doesn’t like to lose. According to the New York Times, Mr. Trump all along has wanted to shift to tax cuts after it became clear that health care would face tough going. His message on the campaign trail was economic -- about how lowering taxes and other moves, such as lightening regulations, would boost the economy.

This argument remains potent. For all the economic advances since the Great Recession, growth remains anemic. The Federal Reserve forecasts tepid increases in gross domestic product of around 2 percent annually for the next three years. That is the pace we’ve seen for most of the past eight years. And the president has forged an alliance with Ryan and other Republican congressional leaders that could help him push his program to enactment. “There is more agreement about tax reform” in Congress than on the health question, Ryan said.

And while congressional Republicans have a solid cadre of budget hawks who oppose willy-nilly government spending, fixing the nation’s physical plant has a solid appeal, too. Plus, bringing back federal largesse has broad support among pols. A member of Congress benefits if he or she can say to voters, “You wanted that bridge fixed, well, it is,” M&R Capital’s Maloney said.

On the minus side, Mr. Trump is new to the Washington scene. Certainly, the president’s strong suit is not horse-trading over specific legislative provisions, such as accelerated depreciation and revenue offsets. “The guy is used to doing real estate deals,” where there are two participants, not the 535 in Congress, said Steve Bell, senior adviser at the Bipartisan Policy Center. “This is not a real estate deal.”

Competing with the GOP leadership on the Hill and the White House are the vast legions of lobbyists, whose employers shower representatives and senators with campaign contributions. Many an earnest proposal in Congress has foundered in the Washington swamp of influence peddling.

The markets have the momentum to rise, tax cuts or no. The post-election stock rally has been called “the Trump trade,” but buoyant economic news also has had a big role in propelling it. Let’s say that the president’s tax and infrastructure plans take a dive, the same as the health initiative did. There’s a school of thought that all the Washington turbulence won’t matter if it produces nothing or very little -- because the economy’s improvement will keep investors happy.

Aside from the so-so GDP growth numbers, numerous economic indicators are positive: consumer sentiment is healthy, wages are higher, business capital spending is expanding, oil prices are stabilizing, corporate earnings have recovered. “The truth is that the economy is getting better, and the market notices that,” Northwestern’s Schutte said.

So if Americans receive fatter take-home pay and a fixed bridge, that would be a welcome extra. If not, their investment portfolios may expand anyway.