'That's kind of embarrassing': Dax Shepard admits he got fired from 'Will & Grace'

In Monday's "Armchair Expert" podcast, Dax Shepard talked with "Will & Grace" actor Sean Hayes about the sitcom - which Shepard was fired from. Ouch.

Dax Shepard is getting real about rejection.

During Monday's episode of his "Armchair Expert" podcast, Shepard talked with "Will & Grace" actor Sean Hayes about the hit NBC sitcom – which Shepard happened to be fired from. Ouch.

News that Shepard was tapped to guest star on "Will & Grace" broke in November 2017, but the actor says his table read did not go over well. In fact, the show's producers and creator decided to go in another direction.

Related Video: Kristen Bell and Dax Shepard Are Our Favorite Couple of All Time

"Had it been any other thing with a bunch of strangers, I would have been like, 'Oh, whatever. I was at a table read for 45 minutes and then I got fired. Who gives a (expletive)?'" Shepard told Hayes, who was present at the table read. "The only (unfortunate) thing is there was no anonymity to it for me. I knew many of the people at that table read."

Related: Dax Shepard denies report that he cheated on Kristen Bell in Instagram post

He continued: "I think maybe that was the only element that I was like, 'Well, that's kind of embarrassing. These are people that I know – and then, I got canned.'"

Shepard said his agent broke the news to him by phone following a "compliment parade."

"When we're getting about 15 minutes into how good I am in this movie, all of a sudden something clicks where I go, 'Oh, bad news is coming,' " he said. "I go, 'Did I get fired from Will & Grace?' And she goes, 'They're going another direction.' I was like, 'I knew it!' Something stunk."

Ultimately, Megan Mullally's husband, Nick Offerman, was selected to fill the role of baker Jackson Boudreaux. Hayes, who plays Jack McFarland in the show, added: "I cannot believe they fired you."

But Shepard said he's "fine with it now" because he was able to attend his daughter's preschool graduation, which he would have otherwise missed.

"This all worked out exactly as it should."

Shepard and wife Kristen Bell share two daughters: 5-year-old Lincoln (who only recently found out her parents are famous) and Delta, who turns 4 this week.

Related: Megan Mullally reveals designers won't dress her for SAG Awards; Christian Siriano steps in

More:Megan Mullally and Nick Offerman together: It really is a great love (and like) story

This article originally appeared on USA TODAY: 'That's kind of embarrassing': Dax Shepard admits he got fired from 'Will & Grace'