Daniel Dae Kim was wide awake and scrolling through Twitter at 4 a.m. when he realized “The Good Doctor” was going to be a hit.

It was a Tuesday in September, and Mr. Kim, a 49-year-old actor known for his work on “Hawaii Five-0” and “Lost,” found himself in bed in western Bulgaria not far from the set of “Hellboy,” a movie he was filming for release next year.

He had a special interest in “The Good Doctor,” because it represented his first outing in a new role: executive producer. And so, although he had to go to work in just a few hours, he could not keep himself from checking the effusive social-media reaction to the show’s premiere episode on ABC.

When Mr. Kim stumbled onto the “Hellboy” set in the morning, he felt just fine. “I’ve lived with this project since 2013, so one night of lost sleep wasn’t going to make a difference,” he said, laughing.