In 2003, Madonna had a cameo in the beloved sitcom “Will & Grace” but refused to wear her character’s pre-selected corporate clothes.

The pop star took on the role of Liz, the executive assistant that Karen (Megan Mullally) meets in an office after landing a job. The two later become roommates in the Season 5 episode titled “Dolls and Dolls”.

Executive producer and show runner Gary Janetti explained that the Queen of Pop was supposed to be “the kind of woman who wears her sneakers on the subway and carries her shoes in her bag and goes to a happy hour after work and thinks she’s kind of a big deal in her tiny office.”

READ MORE: ‘Will & Grace’ Cast Talk Best Guest Stars, Worst Kisses & More In Farewell Interview

Madonna as Liz and Megan Mullally as Karen Walker in “Will & Grace”
Madonna as Liz and Megan Mullally as Karen Walker in “Will & Grace” — Photo: Chris Haston/NBCU Photo Bank

“So she was supposed to wear, you know, Anne Klein II suits with sneakers and be the kind of woman you’d see on the subway. And Madonna as that is very funny … but Madonna didn’t want to wear any of those clothes,” he said while appearing on Wednesday’s episode of the “Behind the Velvet Rope with David Yontef” podcast.

READ MORE: ‘The Prince’ Creator Gary Janetti Reveals Prince Harry’s Response To Controversial Show

Janetti noted that, at the time, the singer was “at the height of her fame” so she brought her own glam and wardrobe teams to the set.

“She looked fabulous,” Janetti said, “but as a result, it was about 50 percent less funny than it should have been.”

Megan Mullally as Karen Walker and Madonna as Liz in “Will & Grace”
Megan Mullally as Karen Walker and Madonna as Liz in “Will & Grace” — Photo: Chris Haston/NBCU Photo Bank

He admitted that he was unsure if Madonna had “a particularly good sense of humour”, so he decided that trying to convince her to wear the pre-selected outfit “wasn’t a conversation that was going to happen.”

“We even had jokes we had to change because of what Karen said — maybe based on what she was wearing — [because it] didn’t make sense anymore,” Janetti told Yontef.

READ MORE: ‘Will & Grace’ Creator Responds To Rumours Of On-Set Tension: ‘It Was Not An Easy Year’

“I mean, she looked like Madonna. She looked like a rich, fabulous celebrity, which wasn’t what the character was,” he added. “But she was game when she was on the show, and she was also funny.”

Janetti also chatted about Cher, who appeared on “Will & Grace” when he wasn’t working on the show, noting he was “devastated” because he “adores” her, adding that “everybody loved her” as a guest.

Speaking of Britney Spears, who appeared on the sitcom around the time she “was getting sh*t from the press,” which Janetti noted “now we see how cruel that was,” the producer gushed about the singer being a “terrific” guest who was “so lovely” and “so game.”

Other notable guests that Janetti loved having on the show include Jennifer Lopez and late actor Gene Wilder.