Bad Example: Xander and Anya in Buffy
The problem is that Xander's vision, which leads him to call off the wedding, is not based on Xander and Anya's actual personalities.
It is, rather, a twenty-something generic vision of "marriage-bad!" Someone as intelligent and commonsensical as Xander should have been able to see through it. But he doesn't.
It's bad writing. The sheer immaturity sends the show back into high school territory (which it never comfortably left).
Good Example: Al and Ilene in Home Improvement
Al and Ilene start dating in Season 2. In Season 5, they get engaged. In Season 6, the day of the wedding, they break-up.
It's entirely believable for several reasons: one, both parties have had doubts for a while; two, the overall impression, throughout Seasons 2-6, is that the relationship was mostly based on two reasonably decent people enjoying a relationship based on being reasonably decent people. They aren't compatible. They just aren't jerks. They could arguably have gotten married and the marriage could have arguably worked, but the moment when they both wanted marriage for its own sake has passed.
The fact that Ilene gets engaged almost immediately after the break-up is a give-away.
From a writing perspective, I think the Home Improvement writers realized that they wanted to save Al's marriage for the final season. The time for the wedding, from a writing perspective, had also passed.
And I always liked Al with Trudy!