like characters that sanji can't beat such as the right hand man that zoro always fights and sanji always loses against like vergo,gin and king
you need to look at context of those situations
being a right hand just means being the closest to the captain in an aspect, like being the first member, and do not forget zoro and sanji are the wings
everyone that engaged in a battle against king the wildfire and queen the plague treated them quite similarly
vergo ran away from the gas and sanji needed to save the marines and tashigi
sanji got beaten by pearl on purpose before gin, they even said that sanji already had got too much of a beating and that influenced in his perfomance against gin
sanji put himself in a though spot by trying to save momonosuke, king just did what was expected given the situation sanji put himself in