PM Keir Starmer had his political survival strategy all mapped out. But he didn't reckon on Nigel Farage.