I mean, this is Zoro, Zoro doesn't treat Sanji like he treat the others and vice versa, thats just how they work together and Oda plays with that. Big Mom's cake would probably be messed up by poison and it wouldn't work as expected and thats why Sanji didn't want to poison it AND seriously the most important, it wasn't supposed to be a gag thing.
You can argue it may be a bit out of character based on how Sanji treats food, but i think it was the point of that scene, showing how dumb Zoro and Sanji are when they are fighting and arguing for some shit. Zoro asks for him to put razorblades and poison on his food to see Zoro himself can digest it, Sanji simply does what he asked for. Taking it too its like saying Zoro tried to hit Sanji with Enma for real after Sanji makes fun of Zoro cuz his bounty is lower, thats just how they work sometimes