Is there something odd about the code, so that the time when you were supposed to eat the cheesecake was changed from before the pregnancy, to after? I thought it was only supposed to work if you did it beforehand, but people seem to be getting twins this way.
I have no idea if it would work before pregnancy (but I am pretty sure it would not) but I can surely tell it does work 100% once they are pregnant.
See the problem is that if it would work before pregnancy, for how much time before they try to woohoo would the "cheesecake" take effect? I would definitely be scared to make any of my Sims eat some cheesecake if there is no time limit to that effect. Maxis probably (though they can surprise us all the time) made it too work only after pregnancy so it is easier for the game to take track of this. I have no way to confirm this since I am not awesome enough to create mods or check that, but according to TJ, this works only once they are pregnant and it definitely makes sense.