Have you tried ignoring the friends' complaints, cancelling out any automatic commands to leave the house, and continuing cooking?
I have a 'moocher' family (inspired by various versions of the homeless challenges) that sometimes eats and sleeps in the parks/venues, and sometimes at the homes of the people they hate the most.
Almost split my sides laughing as one after another of the household members marched up to the beds were my sims were sleeping, and demanded that my sims leave at once. Queuing up multiple 'sleep' commands prevented my sims from ever getting out of bed; if they even woke up, they simply went right back to sleep again, leaving the homeowner sims standing at the bedside, fuming. Hilarious! (Well, not so hilarious if it happened to you in real life, obviously, but in-game it's highly amusing.) Eventually, the homeowner sims gave up!
While I've succeeded multiple times in ignoring sim-homeowner complaints about sleeping, my sims have been eating food the sim-homeowners cooked, rather than cooking themselves (hey, my sims don't want to spend any money). They wait until the homeowner family is about to eat, distract them with a comment, and then snatch the plate away. Heh, heh. (Actually, the homeowner sims usually don't even eat the food; they cook it, set it down, and complain about how hungry they are--and by then, my sims have snatched the plates away.)
So...don't give up; queue up multiple 'continue cooking' commands, and maybe you'll be able to finish cooking without being ousted from the house!
'Course, I'm not promising such disrespect won't affect your sims' relationships.... :naughty:
(edited for typo)