I'm no doctor, nutritionist, or anything like that, just my own experience with endurance sports, but here is my take: I would suspect a combination of dehydration, electrolyte imbalance, and not enough calories getting digested properly (note, not eaten, but digested and absorbed). I've had almost identical symptoms quite a few times in the past. The last time I experienced it was a few years ago training in the heat for an ironman distance triathlon. For me the trigger is some dehydration, plus the wrong combination of foods, then trying to push through it basically shutting my body down eventually: bad headache, nausea, overheating, waves of chills, cold sweats, elevated heart rate, inability to sleep.
To cover that distance in those conditions, the speed, trail time required with the heat, you have strayed from the hiking to an intensity that would be an endurance sport. Hang around the finish line at any all-day endurance event and you'll see a lot of similar symptoms to what you describe. At higher intensities, a little bit of dehydration, or the wrong combination of foods shuts down their digestive system, they can keep eating, but things aren't getting digested, glycogen stores get burned up, blood sugar drops, dehydration kicks in and the results can be nasty.
Endurance sport forums have many posts from people who are very physically fit and well trained, but are wondering what the heck happened to them when they pushed themselves further/farther/faster in tough conditions and they basically shut down. The lesson on those forums is that muscular endurance and fitness is only one aspect of the training, and that nutrition is critically important and is an aspect of endurance sports that must be trained and dialed in as well. Basically everyone has to experiment in exerting themselves all day in tough conditions and find the right combination of foods and fluids that works for them. I know this forum can think of gatorade, gels and other sports nutrition as simply marketing hype, but in tough conditions at higher intensities, the stuff really works well, at least for me, but it took over a year to fully dial in my nutrition plan to find the combination products, intake rates and timing that really worked for me.
I will say though, pretty impressive mileage in tough conditions to gut it out like that.