I don't know which system applies, so I have to try to be system agnostic.
First of all:
Well, we better break down the problem to the core sentences before we go about solving it.
- The players get the task to transport a mighty item.
- They are expected to give it to someone by their quest giver.
- The players are known/suspected to abandon the quest and keep the item.
Now, we take in mind some more factors for more in depth details that will have to influence the answer:
- The Questgiver has some sort of precognition/makes prophecies
- The item in question is the royal insignia
- Possession of the item is said to make you king
- The item has some "worthy test" before bestowing its powers
Self Fulfilling Prophecy
Let's assume Merlin did not choose the PCs because of their virtues, but what he saw for the future made him choose them. In this case, he was not only fully aware of them taking away the sword, putting the old Camelot to ruin as the Ursupators fight to keep in power without the sword. He also knew that the PCs would not bring the sword to the Stone or the Lake but would keep it for themselves - he even planned with it!
However, as Merkin knows better, he also knows that in the end, the PCs will have to bring the sword to the Lake in one way or another. Maybe they become warlords for some time, ruling with the sword as a useless icon (because it doesn't bestow its powers on unworthy thieves), but in the end, some sort of miracle just fixes their error. There are many possibilities how this might happen, but here are some:
Last stand at the shore
While they play Ruler for some time, others assault them and at some point the odds become overwhelming, forcing them to retreat and flee their castle. As they become surrounded, Excalibur in their hands, a lakeshore in their back, something happens and the sword is lost, tumbling into the lake. Maybe the players get the players get a glimpse of the Lady as they become encircled and maybe they toss the sword in themselves before becoming overwhelmed (it's some sort of late repent).
The tone of this campaign will have to be pretty dark, and it might make your players angry, not for losing Excalibur, but for losing everything.
If the players are really paranoid, they will never leave the sword out of eyesight. Maybe they manage to unify Camelot for some time again, maybe not, but in the end, there will be some reason for them to travel or take a hike or hunt - if they are rulers or outlaws. As they do so, they pass a lakeshore (it's the Lake of the Lady of course). Maybe the horse of the one carrying the sword at the moment stumbles on a cliff above the lake and both fall into it, the sword vanishing as soon as it touches the water while the player might rescue himself.
This might sound cheaty to the players, but it could set the stage for a new part of the campaign more devoted to redemption.
The Artifact becomes a liability
Excalibur might be the most mighty sword, the holiest one, and the purest one, but it only bestows its full power on a worthy king and denies everyone else any fraction - and even should someone once worthy become unworthy, it will deny being wielded. This is true even for Arthur: he had to prove his worthiness in some legends.
In our problem, the sword will not be able to be pulled from the scabbard, it will not gleam in the sun to heighten the hearts of the knights, maybe it even becomes heavier the more one proves to be unworthy (see "The Sword as Quest" below). Also, it might attract others, people that are clearly more worthy than the band of Knight Errants that carry it around as loot, and they become a constant pest. In the end, you can only hope that the players will give back Excalibur to the Lady because they want to get rid of it.
Problem here is, that this still might look cheaty, because they expected something different.
Deus Ex Machina
Maybe Merlin didn't know about the traitorous hearts of his questing group beforehand. But he is still a sorcerer - and can't really stand to not be right in the end. Also, he is pretty fond of traveling in disguise, giving advice to the questing heroes and trying to steer them clear of their impending doom - which is why he is always right after all. He wants them to succeed, and as this group of heroes steers further and further from the path, he might make occasional appearances to tell them how to gain redemption and freeing of the curse under the guise of friends and passersby.
But then again, he is the near godlike Merlin, and if they don't want to follow his advice, he will engineer situations that make it so they have to or die. Or, to pull the real Deus Ex Machina, he just takes the weapon from them by force after they have it far enough from the castle. He is Merlin, the one who is always right, after all.
The Sword as Quest
This would draw from the Arthurian legend even. Give Excalibur properties that are bestowed upon the "Sword of the Strange Clasps", which could only be pulled free by Balin in the Suite du Merlin and Le Morte d'Arthur, and keeping it longer than told would bestow a curse. A short retelling of the tale:
The sword, as mighty and strong it was, came with some catches: First, it was affixed to a Lady and could only be freed by the noblest knight. This was Balin, the lowliest of all the Knight of the Round Table. But it was also a perfect sword and the Lady that had brought the sword said, that once freed, she would have to be given the sword.
As Balin wanted to keep it, he was prophecied that his most loved one would die, and then another prophecy followed that he would die along with a fellow knight in a duel.
The Lady of the Lake only delivered Excalibur after this, and passing it to Arthur she demanded either Balin's Head or the head of Lady Lile as he had promised to avenge one of her family. Arthur refused, Balin "slew" Lady of the Lake, Arthur cast out Balin and he went on a quest to try to regain the favor.
After some duels and being allowed to return, Balin still was cursed to die in a duel. In another quest to try to regain some honor lost in other means, he went to a castle where he jousted another knight because of a custom. Because both had accepted shields from the castle, they didn't recognize each other as the close brothers they were, and slew each other. As a result, Balin's sword was embedded into a stone, until Galahad would draw it from there. (Here be more on that, under the "Knight of Two Swords")
A plot like this would turn the whole story into one of those tragic legends, where it is not about the heroes winning in the end, but how they valiantly try to prevent their impending doom. This actually can be quite rewarding for the players - if they are up for the challenge.