In "I'm Okay, You're Defective," Frasier's then-wife Lilith pressures him to write a will for the sake of her and their infant son, Frederick. The episode ends with a flash-forward to an elderly Lilith having what's supposed to be her husband's will read to her, although it actually ends up being a report on Sam Malone's sperm count thanks to sitcom shenanigans.
But the point is that, while Frasier may have divorced his wife, moved to another city, pursued a new career, made amends with his long-estranged family, and had numerous new relationships as he looked for love, in the end it's all irrelevant. That one throwaway joke means Frasier is destined to return to Boston and get back together with his ex-wife. It's like a sitcom version of Final Destination, only instead of death, it's an unhappy marriage that you can never escape.