I don't know the ins and outs of your situation OP but don't give yourself a hard time over this.
You could sit him down and apologise and explain you feel bad about how you've behaved and won't do that again and I think that memory would also stick with him and show him we all make mistakes when we lose our rag but we're always working to be better.
Now I am a SEN mum, I have a picky eater child, and this is advice you haven't asked for so feel free to disregard whatever I say.
My son is a picky eater. He also has a lot of anxiety surrounding school, and it impacts his appetite significantly.
We follow a bit of an Ellyn Satter method.
I never ask him what he wants, I ask him would you like X or Y, and then I make X or Y, but I always put a safe food like toast on his tray - not plate.
I don't tell him he has to eat this or he can't have dessert, if he was going to be allowed it anyway, it all goes out on the table.
This prevents decision fatigue and also creates a low emotional arousal approach to eating.
A lot of my sons meals are complete crap. The doctor literally said to us, if it's what he will eat that is what you feed him.
So sometimes on his tray he has a dish of strawberries or cucumber or watermelon, some pringles, an ice lolly, some toast and some turkey dinosaurs.
We also add a small portion of what we eat to a small dish too, but not always. We don't eat at the same time often enough for it to be always.
I don't know if your sons issues surrounding eating are chronic or relatively new, so this might not be helpful to you at all, but it has helped take the stress out of what we do when it comes to food and it also gives my child more autonomy over his food choices which decreases his anxiety.