Here's a way that might be easier to understand.
If you have a tape worm. You can eat and eat and eat. You won't gain weight, you won't grow.
You will STARVE
BUT you are eating. Your body is starving and you will eventually die of "starvation".
You are "starving" your body of nutrients.
That's probably what happened here. There was something wrong with this baby. He ate and ate and ate, but his body was starved for nutrients because they weren't being absorbed.
You can eat, but still starve.
Using your puppy example.
I rescued my first dog. full of tape worms. He ate 6 cups of food a day. More than he should at his age. 8 lbs (shepherd) pup (very thin).
He DID NOT gain weight. He ATE AND ATE AND ATE.
It took 6 rounds of de-worming to get him to be rid of tape worms. But his body took 2 years to recover. He looked emaciated for 2 years, like he was being starved.