This is also apparently two jokes in one (as 30 Rock is known for). From the IMDB trivia page for “Rosemary’s Baby”:

When Liz meets Rosemary (Carrie Fisher) at her book signing, Liz exclaims, “You are great! I grew up wanting to be you!” and Rosemary responds, “I grew up wanting to be Samantha Stephens on Bewitched. But the closest I got was being married to a gay guy for two years.” This is a reference both to the behind-the-scenes private life of Dick Sargent (the second actor to play Darren Stephens on Bewitched) and to the fact that in her real life, for a few years in the early 1990s, Carrie Fisher’s romantic partner was the Hollywood agent Bryan Lourd (father of Fisher’s only child, her daughter, Billie) before Lourd left her for a man.