The result of the Clacton by-election was never really in doubt, but the finale was anything but predictable.