Something wrong with his gut?
That was the first thing that came to my mind as well. My horse has, from what we've been able to deduce, some sort of IBS that doesn't show up on any of the many, many types of tests we've done. A lot of what Sako is showing is similar to what we saw. Sometimes okay, sometimes not. Sometimes I could get him eating for a meal or two by changing things up (where he was eating, his bucket, the type of grain), but he'd quickly go off that as well. Stress at feeding time (Tristan would just go to the back of his stall and not interact at all, whereas he's normally very social, wanting to hang his head out the door). We never saw a single sign of tummy issues other than the eating - normal manure, no colic or anything.
The vet finally suggested trying him on Prednisolone as a last ditch effort before putting him down last fall; it was like night and day within 24 hours. I'm certainly not a vet, and obviously stuff needs to be prescribed, but I wonder if trying him on some sort of steroid or something for tummy issues for a few days might be helpful from a diagnostic standpoint? You could see if it seems to help or not, and go from there.