“The Good Doctor” has become a big hit for ABC. Millions of viewers have embraced the drama about a young surgeon with autism and savant syndrome who solves medical mysteries at a prestigious Bay Area hospital.

But the critically acclaimed drama had a touch-and-go moment of its own — before shooting even began.

In an interview this week with the Los Angeles Times, the show’s executive producer, David Shore, described a tussle that he had with a major Hollywood talent agency as he prepared to pitch the show to ABC programming executives in 2016. The fight was over packaging fees, the longstanding industry practice of talent agencies taking fees for putting together a lineup of their clients — actors, writers and directors — for a show, rather than receiving the customary 10% commission on each client’s fee.

Ending packaging fees has become a rallying issue for writers, including Shore, whose union has taken the unusual step of asking its members to fire their agents when they would not agree to renounce packaging fees and other practices that writers say pose conflicts of interest for the agents. Shore says packaging fees are part of a larger problem: agencies that are looking out for their own financial bottom lines and not the careers and earnings of their clients.

‘Flawed system’

So before “The Good Doctor” was shopped to TV networks, Shore told his agents at ICM Partners that he did not want his show packaged.

Shore believed the fees would inflate the cost of the show to pay agencies that would contribute little to the day-to-day operation of it. He wanted to see those fees put toward improving the show itself. “It’s taken money off the screen, and it’s just a flawed system,” said Shore, a veteran showrunner who also created the long-running hit medical drama “House” for Fox.

Shore said that when talent agency William Morris Endeavor found out that there was not going to be a packaging fee, “they threatened to blow up the deal” the day before the show was to be pitched to TV networks. WME represented EnterMedia Contents, which holds the rights to “The Good Doctor.”

“I don’t know how they [WME] would blow up the deal but that was what the threat was,” Shore added. ICM and Sony Pictures Television, which produces the show, talked to WME and the issue was resolved, he said.

“The Good Doctor” ended up having no packaging fee attached — which is unusual for the industry, according to experts. Nearly 90% of scripted series covered by the Writers Guild of America were packaged during the 2016-17 TV season, according to the guild. Of the packaged series, WME or CAA were involved in 80% of them, the guild said.

Shore has plenty of clout when deals are fashioned as part of a rare group of showrunners who have created at least one successful show. Shore said he believes not having to pay those fees allowed him to spend thousands more on the show and hire a larger writing staff. Sony, ICM and ABC declined to comment.

WME said it was informed late in the negotiation that Shore did not want to do a package on the show. A representative for the firm said there was a delay because the deal structure changed and the agency had to inform its clients that they would owe their usual 10% commission fees because there was no packaging deal. While confirming that “The Good Doctor” had no packaging arrangement, WME said it had split packaging fees with ICM on a show Shore was involved with called “I Spy” in 2016.

Gamble pays off

An industry source who does business with Sony and the agencies and asked not to be identified said the amount of upfront packaging fees for a one-hour broadcast network drama would be no more than $30,000 per episode in total, which they estimated would be a fraction of a percent of the budget for a series such as the “The Good Doctor,” adding that the fee would likely be split between any attached agencies. That amount would have gone back to the studio, not to the show’s budget, the source said.

Shore’s gambit may have paid off. “The Good Doctor” was ABC’s most-watched show in the just-ended TV season with an average of 12.6 million viewers per episode, according to ABC — a big number in an era of shrinking network audiences. The show, which just ended its sophomore season, in particular reaches young viewers and well-educated audiences, which makes it a hit with advertisers.

Shore said that when his earlier hit, “House,” started, he didn’t realize that the show was packaged at the time, because the packaging was negotiated without his involvement.

“The fact is they [agents] are earning that money on the leverage of ... collective writers’ power,” Shore said. “If they can negotiate that money for themselves, they can negotiate it for us too.”

Packaging is one of the key issues in the dispute between the Writers Guild of America West and the Assn. of Talent Agents. Thousands of writers have fired their agents in hopes of gaining more leverage in negotiations with the agencies. Talent agencies say writers benefit from packaging because agents generally waive their customary 10% commission fee when they sell a package. The guild and the talent agencies are also engaged in a legal battle.

“We are trying to correct a flaw in the system, which I believe will result in greater compensation for writers over the coming years,” Shore said.