The reason, according to people familiar with the episode: Perrigo learned J.P. Morgan was simultaneously advising on another deal that would undermine the drug maker’s defense against Mylan.

The episode highlights the pitfalls for merger bankers in the current deal boom, which has been marked by complicated, quickly shifting takeover battles. Corporate boards have become hypersensitive to conflicts—real or perceived—and are demanding a higher degree of loyalty from their advisers, said bankers, lawyers and corporate executives.

“The question you ask is: ‘Will your bankers be working as hard as they can for you if they’re trying to do business everywhere else?’” said Jim Rogers, former general counsel of Orbitz Worldwide Inc., which was sold to
Expedia Inc.
in September.

The company considered hiring a pair of big banks but worried about their ties to potential bidders and related parties, Mr. Rogers said in an interview. Orbitz hired boutique Qatalyst Partners instead.

The boardroom scrutiny is shaking up the market for mergers-and-acquisitions work. Big banks are becoming more selective about which assignments to take, wary of finding themselves locked out of others or of offending clients. And the process of hiring bankers is becoming more fraught, with lawyers peppering potential advisers with questions before they can get retained.

Companies also are sending record amounts of work to boutique investment banks that pitch themselves as conflict-free.

Navigating conflicts is tricky, especially for a sprawling bank like J.P. Morgan, which has a vast web of relationships and imperfect visibility into what clients are up to. Rapid consolidation in industries such as health care, as well as a spike in hostile deals, have further complicated the choices facing bankers.

But a lot of money, and bragging rights, are at stake. M&A volume is running near record levels and advisory fees are feeding a bigger chunk of bank profits as trading slows.

The boardroom anxiety stems from a rise in shareholder lawsuits targeting bankers. About two dozen such suits have been filed since 2014, claiming financial advice was tainted and seeking millions on behalf of investors. Directors and executives often are named as defendants, too, and companies typically must foot their bankers’ legal bills, which serve as strong incentives to root out conflicts before they arise.

If a company is hiring advisers to run a sale process, past work for potential buyers is a red flag, bankers and lawyers said. So are big lending arms that could skew bankers’ advice toward events that would generate financing fees.

When
Williams Co
s. was negotiating its pending combination with
Energy Transfer Equity
LP, it hired Lazard as a second adviser after becoming concerned about past work that its bankers at
Barclays
PLC had done for ETE, securities filings show. Thoratec Corp. hired Centerview Partners for a second opinion on its sale to
St. Jude Medical Inc.
last summer after learning that its bankers at Guggenheim Securities had earlier pitched St. Jude on the same transaction, according to filings.

And science-lab landlord BioMed Realty Trust Inc. last year hired
Raymond James Financial Inc.
to give a second opinion on its sale to
Blackstone Group
LP in part because of ties between
Morgan Stanley,
its main adviser, and Blackstone, a person familiar with the matter said. Morgan Stanley owned 6.6% of Blackstone’s stock through its asset-management arm and had received $192.8 million in fees from the private-equity firm over the previous two years, filings show. BioMed’s board worried that shareholders might later argue that Morgan Stanley orchestrated a sweetheart deal for a favored client, the person said.

“Of course there are conflicts given that the leading banks have broad relationships,” said
Robert Kindler,
Morgan Stanley’s global head of M&A. “What’s important is that they are fully disclosed.” He declined to comment on specific deals.

To that end, law firms including Davis Polk & Wardwell LLP and Skadden, Arps, Slate, Meagher & Flom LLP have started sending out questionnaires to banks pitching their corporate clients, people familiar with the practice said. They ask how much banks have earned from potential bidders over the past few years and whether they have any financial interest in a transaction, such as through debt or swaps.

Bankers in many cases are bristling at the heightened scrutiny. Some answers aren’t easy to come by and disclosing others would breach confidentiality agreements, they said. And there is another concern: Their answers might prompt the company to hire a different bank.

This new scrutiny is a boon to boutiques, which have fewer of the entangling relationships that can unnerve clients. Qatalyst founder
Frank Quattrone
recently attributed some of his firm’s success to “a backlash against conflicts of interest at big banks.”

Boutiques earned a record 19% of M&A advisory revenue in 2015, according to Dealogic. Often they are brought in alongside a larger bank to provide a second opinion, but are increasingly handling assignments solo.

Some deal makers see an overreaction, adding that what looks like a conflict can actually be a benefit. Bankers with deep industry ties can work faster and secure a better price, said
Steven Seidman,
a lawyer at Willkie, Farr & Gallagher LLP.

“The reason you hire the big banks is because they’re in the mix, because they know everybody,” he said. “Those relationships are incredibly valuable.”

Bank of America Corp.
advised Furiex Pharmaceuticals Inc. in its 2014 sale to Forest Laboratories Inc. At the time, Bank of America was financing a takeover of Forest Labs, which effectively put it on both sides of the Furiex deal.

Furiex directors determined that relationship “had, in fact, been advantageous in facilitating a potential transaction,” according to a regulatory filing, but they hired
Credit Suisse Group AG
to give a second opinion anyway.