What am I doing wrong?
You seem to be assuming that your child is in some way being irrational about eating – eg by not eating despite being hungry and/or lying, to you or himself, about not being hungry – or that he's unable to be hungry (which is false, see below).
What can I do?
You can take your child seriously when he says he's not hungry and accept that.
[D]oesn't a child have a hunger stimulus?
Of course children have a hunger stimulus. One of the reasons babies cry is that they're hungry, and then they stop crying when fed. If babies have it, so do five-year-olds.
What will happen if they keep on not eating or don't eat at the right time?
Well, any biological organism needs some energy source to sustain itself. I'm not a doctor, but from what you've written, it doesn't sound like your child is anywhere close to starvation or you would have mentioned something like very low weight, bones showing through skin, stuff like that.
The right time to eat is when hungry. If your child says he's not hungry, it's not the right time. If you're insisting your child eat when you want him to instead of when he wants to, you're insisting he eat at the wrong time. That's a surefire way to ruin his relationship with food (and with you). Hence why Bentley Carpenter's suggestion that "taking the phone away [...] will help them learn to eat healthily" is ridiculous – the opposite is true. All he would learn is that problems are not soluble (which isn't true), that you exist to thwart his goals (which, sadly, might be true), and that eating means he can't have what he wants (in this case, his phone).
I'm guessing going through the trouble of cooking for your child and then him rejecting most of the food can be disappointing. So consider only cooking when your child tells you he's hungry. If cooking takes too much time, or if you can't cook on short notice, meal prepping could help. Or have ready-made food on hand that you can heat up in the microwave or serve cold. Either way, feed him things he wants, not things you want him to want. If you think he's only interested in unhealthy foods, try to persuade him of alternatives, but don't force things on him.
The world of food is wonderful, and I hope your child learns to enjoy it. Good luck.
EDIT: I just found this answer you may find helpful (but ignore the part about how to "get your child to eat at mealtimes", and I haven't opened the linked resources).
EDIT 2: A mod flagged this answer as needing sources, including a threat of deletion. Why? The answer already contains a source, which in turn links to several other sources.