Sanji initially stopped Doflamingo with his leg, then Doflamingo dodged his next attack, then started resisting the third one, he had no choice but use his arguably most broken move to stop Sanji's attack, just as he did to stop Luffy and Law.
And thats cuz Sanji wasn't even aware of Doflamingo's powers