King Candy is later alerted by his security of a break-in at his kart-baking factory.
He then tried to destroy Princess Vanellope by deleting her code, but his attempt was unsuccessful, as his tampering only managed to turn her into a glitch.
This restores Vanellope's code and position as sovereign, while King Candy's is obliterated, freeing them from their binds and the chest is gone for good.