The by-election defeats in Wakefield and Tiverton and Honiton on Friday came after the prime minister faced months of criticism over parties in Downing Street during lockdown, alongside soaring inflation and a narrower-than-expected win in a confidence vote from his own MPs.