Ms. Gupta, who published humor pieces at McSweeney’s and The New Yorker while still in college, and later wrote for the ABC sitcom “Speechless” and the Netflix show “Friends From College,” joined the writing staff in June. In early August, after a dinner for the cast and crew at Pizzeria Mozza, Ms. Gupta was standing with Mr. Hunt and others in the valet-parking area. She said she had not met him before that night. He hugged her twice from the side, Ms. Gupta said, before he complimented her pants and ran a hand up the side of her thigh.

Bryan Freedman, a lawyer for Ms. Heaton and Mr. Hunt, said in an email that his client “did not remember the details as described” and that he “does not recall rubbing anyone’s thigh or leg and he disputes that characterization of it.”

Ms. Gupta said the experience outside the restaurant made her uncomfortable. On her way home, she called her boyfriend, Greg Gallant, a television writer, and described what had happened. A friend, Dylan Gelula, an actress, later went to her apartment, and Ms. Gupta told her about the incident. (Mr. Gallant and Ms. Gelula confirmed the conversations they had that night with Ms. Gupta.)

Mr. Gallant said he encouraged Ms. Gupta to complain to the showrunners. But the women had reservations. “We both kind of decided that it would be bad for her to do anything about it,” Ms. Gelula said. “And, clearly, we were correct.”

For several weeks, Ms. Gupta said, she told no one at “Carol’s Second Act” about her accusation against Mr. Hunt. But then, she said, there was another instance of unwanted contact.

She was seated on a high folding chair, the kind known as a director’s chair, on the lot. Ms. Magee, the co-executive producer, was seated next to her as Mr. Hunt approached. He seemed to be looking for something, Ms. Gupta and Ms. Magee said, when he took Ms. Gupta by the shoulders and jerked her forward. Ms. Magee jumped out of her chair and said, “Excuse me,” she told The Times. Mr. Hunt said nothing and walked away, the two women said.

Mr. Freedman, the lawyer, said Mr. Hunt “remembers looking for a script but does not remember the detail of touching anyone’s shoulders, and if he did that, it was not intended to be offensive.”