It’s not “social media” - both PMs have taken actions that are fundamentally repugnant to their MPs and their electorate, and they are being forced out.
Nobody forced Boris to go to parties, hand out PPE contracts to his mates, try to rescue an MP found to have taken bribes, or to defend a serial sexual assaulter.
Nobody has forced Liz Truss to bring in tax cuts the fucking IMF thinks are ill-advised (the IMF is not known for its socialism).
Unless you think PMs shouldn’t be answerable to their MPs or voters under any circumstances, in which case let’s just install a dictatorship and have done with it. Why bother with a parliamentary system at all if PMs can override it?