I guess I missed that you were changing the food surplus in the middle, to get a 7-food surplus on the first and last turns and zero surplus on the other turns.
Not zero - a little bit less than 2, actually ( 1 + P/9)
I was assuming you'd have the same food surplus each turn. Are you assuming that you can switch back and forth between high-food and high-production tiles?
Not quite - closer to say that I'm observing that you can tune the loop if you can switch back and forth between fungible tiles.
Example: consider a 6->4 whip with dry rice. Dry rice and three farms is +7, so we can hit the beginning and end targets. In the middle, rice + specialist + 3 cottages is a little bit too fast (3 food to many), but we can tune that with a farm and a second specialist. Easy.
Now, replace the dry rice with wet corn, hitting the 7 got easier, and in the middle we've got two specialists and two cottages. That's still a little hot, but we can tune it with a farm and a specialist... whoops - so we need a third specialist slot to make that work.
Now try wet corn and a brown cow. Hitting the 7 is easier still, but it's getting harder to slow down in the middle .
With wet corn and flat pigs, it's basically impossible. You have to resort to other measures - training a worker or a settler, not working a good tile (horrors! but maybe another city can use it for a time) etc.
On the other hand, we have situations where the tiles aren't fungible.
Consider dry rice, with four green mines. The sixth pop is working a cottage.
If we whip from here, we end up switching from mines to farms on the growing turns, and we also don't get to work all the mines while trying to grow. Assuming I've done the math right, you get 29 mine turns instead of 44. 15 lost turns on the mine is 45 hammers, so all this work earned +15

(ignoring setup cost).
If we had a fifth mine - well, it's useless in the whipping case, but parking at size six you can alternate the mine with a farm, so you are effectively working another half mine. In this example, the whip is actually a little bit behind ( either behind by 1F, or behind by 3H-1F, per loop).
That result shouldn't be a surprise - CW has long held that you shouldn't be expecting extra production when whipping away mines.