The catcher made the correct play by trying to cover third when he saw third base was open.
IMO, the pitcher blew it, however. He was lolligagging in the infield near SS, where there was nothing that he could contribute to the play. In that situation, a player should be thinking where he should go to provide support. In that case, he should have realized he should be in position to back up an infield play on the runner. And on that premise, he should have been looking to back up at either third or home. When he then saw third was open, he would have covered there, and the play would have stopped with the runner at second.