To me, it sounds more like a bug. If he's truly been this sick for 8 days and is lethargic there is reason for concern. Call the pediatrician and/or speak to the advice nurse.
I've usually hesitated to call the advice nurse thinking that my symptoms will go away and they usually do. But I have advanced cellulitis now because I didn't call the advice nurse. The cellulitis is up my leg in only 1 1/2 days. I will always call her now when I sense something is wrong. I think if I were a new mother I would put her number on my speed dial.
He cannot still be upset by the cake. And I've never heard of anyone getting sick eating sweets unless they've eaten a very large amount. They usually vomit and it's over with. My granddaughter has gone overboard on sweets and she only felt bad for a few hours.
I think you would know if the teething is bothering his system he would be very fussy and cry alot. The teething pain only lasts until the tooth erupts. Of course there is frequently another tooth trying to erupt.
What I understand from your message is that he has just started to refuse food and the digestive system seems to be your primary concern.
In my experience lactose intolerance does cause diarrhea and can upset the tummy for a short while after drinking milk or eating a dairy product. He would also be gassy and his tummy might look bloated. But this wouldn't go on for days without continued consumption of dairy products.
Lactose intolerance is not an allergy. It's the body unable to digest lactose. My granddaughter had an allergy to milk. We learned this when her mother switched to formula when she was 3 months old and started with the vomiting.She did projectile vomiting and possibly diarrhea. She outgrew the allergy. Babies often outgrow allergies because their body develops to the point that they can digest foods.
The reason for uncomfortable reactions to food allergies or lactose intolerance is that the stomach can't adequately digest the food. As they get older their body begins to develop the "chemicals" in their stomach so that they can now digest those foods.
I'm lactose intolerant and I didn't start having symptoms to notice until I was well into adulthood.
If I drink a glass of milk I will feel gassy and sometimes my stomach will feel queasy. One way to help find if that is the cause is to not give him any diary products for several days and see if his symptoms get less.