A couple things come to mind.
The physical activity of looking for poops, bending down to get it, getting up, and putting it where it belongs, is a very monotonous task which requires focus and cognitive power, but is full of tedium. You need to really use your eyes to hone that hand-eye coordination for picking up multiple, small things. I think that cognitive and physical exercise can be migraine inducing. A parallel I’d draw is if your son would get a migraine from needing to weed a lawn?
A big reason this is my initial reaction is I get a major headache from wearing my glasses, which are out dated in prescription, only when they are worn while doing something needing visual acuity. I can wear them for days on end, but if I need to sit in a class or look at my phone excessively for detail oriented work, I get a crazy headache because of the strain.
The answers provided in this discussion are for general guideline purposes only. The information is not intended to diagnose or treat your pet. Seek the advice of your veterinarian or a qualified behaviorist.