The Irish actress and comedienne, 50, created and was executive producer for the HBO series, which premiered in 2016 and starred Sarah Jessica Parker and Thomas Haden Church as a middle-aged divorcing couple.
Appearing on Desert Island Discs, Horgan told how spending five months in Brooklyn, New York, away from her then-husband Jeremy Rainbird and two daughters, took a toll on her mental health.
She said: “I lost my mind completely and I got OCD from it. I developed anxiety.
“I would lie in bed at night and I would feel my heart going and I would think: ‘Oh, I am about to have a heart attack’.
“It was only afterwards that I realised it was anxiety.
“I didn’t not see my kids for five months. Every couple of weeks I would go back or they would come over. But it was still ridiculously long and painful.”
The Catastrophe star recalled how she met up with her family in Austin, Texas, for Christmas but broke her ankle jumping on a trampoline.
“It was terrible,” she said.
“I went back on set and I was an even more annoying presence because I would be walking up to people on crutches giving them notes.
“It was awful but it was a choice we made as a family and lots of good things came out of it.
“It certainly messed me up for a while and I wouldn’t want to do it again.”
Horgan and Rainbird divorced in 2019 after 14 years of marriage.
She told host Lauren Laverne co-parenting had made her question whether she was a good mother.
“I was fun mum for years,” she said.
“I entirely thought that was my role but that changes when you co-parent.
“Everything changes and you take on a lot more roles and I am much more practical than I was, and I think that is a positive thing.
“It had some dips in the middle where I thought, ‘Oh, that thing I thought I was, which was a good mother, I am not entirely sure about’.
“When you bring anything like that into your kid’s life it’s tricky, when you turn the roles upside down, but it balances out and everything eased back.”
Horgan also recalled an incident when, as a young woman, she was invited on a trip to Switzerland by a manager she met through a band she danced in.
During the trip, where she was joined by her sister, the manager filmed Horgan performing speeches and tried her out as a singer.
She said: “This all sounds so mental now that it is making me feel a bit crazy but he got me to do a modelling shoot.
“And then one morning I woke up and he was in the bedroom with me stroking my face.
“We were supposed to be leaving the next day and suddenly we couldn’t find our passports and my sister went absolutely bonkers and we both turned the place upside down and went crazy, and eventually they were suddenly found and we skedaddled – and I never heard from him again.
“But it did do this weird thing that I thought someone was just going to tap me on the shoulder and tell me they were going to sort everything out for me again.
“That stayed in me for a long time, very unfortunately because it meant that I did nothing for a quite a while.”
Her music choices on Desert Island Discs included David Bowie’s Rock ‘N’ Roll Suicide, The Smiths’ The Queen Is Dead and Kate Bush’s Moments Of Pleasure.
For her book Horgan chose The Sun Also Rises by Ernest Hemingway.