The empowered jeers from Big Mom were not enough of a hint? Should the cake have not been baked, Big Mom would be no more. Sanji directly saved her life and that of his enemies with misplaced altruism. What function does a temporary weakening serve if Pageone is combat ready for the impending battle?
do you not remember that Big Mom was on the verge of destroying the sunny before the cake drew her away, giving the SHs enough time to escape?
Had the cake not been baked, not only would the SHs not have survived, the entire country of totland, a country with many innocent civilians, would have been destroyed. hundreds of people would have likely lost their lives or been displaced.
Sanji not only saved the SHs, he saved an entire nation.
similarly with Page one. Page was destroying the livelihoods of the soba chefs, he was terrorizing the entire town. Yes sanji failed to take out page, but he succeeded in his primary objective, which was to protect the civilians by directing page's rage towards him rather than the civilians. In fact, part of the reason Sanji ran was likely because he knew he wouldn't be able to beat Page one without destroying the entire town.