That same thing happened to me when I was in school. Even in University it still happened to me. Even now as a programmer I still see the same pattern happening to me.
I was conscious of the problem, but had no solution. In fact, I don't think of it as a problem, but as an advantage (I'll discuss about this below).
When I do maths exams, I like so much maths problems that I always remember (like in video) all of the exam, including the questions and the answers I gave, and even remember all of my mental process to derive such answers.
But I don't like so much reading the exam itself. And when I don't like something, I'm not very interested in it, to the point I don't care what I do with it or what results/consequences it has.
One of the first examples of the above that I remember is the following: I remember doing an exam when I was 11 when after exiting the exam room I remembered the whole exam and I did it perfect... I did, but didn't read one question that was very short between two long questions, and therefore didn't answer that one. It simply hadn't reached my attention. The rest of the exam was perfect.
Another example I remember very well is the following: I did another maths exam when I was 17, and even though I like them, I don't like to lose 2h of my time in an exam; it simply bores me, and my performance decreases considerably. And at that age, exams start being 2h in Spain (and at university I had 4h exams, in which more like this happened). In those kinds of exams, either I nail it in a very short time (<<1h) and I get out of the exam room immediately, or I'm doing it really bad. In that exam, when I was 17, I almost nailed it in maybe 30 minutes or so. But that day I preferred sleeping in the exam chair rather than going to the corridor, so after giving the teacher the exam paper I simply slept on the exam chair (my teacher was OK with that). After some long sleep, I suddenly woke up and told my teacher that there was a mistake in my deduction and I told her the exact place on the exam paper, and asked her if I could fix it. As she knew for sure that I hadn't talked to anyone or cheated at all, and I was still inside the exam time, she allowed me to fix it. She was very amused that I had been reviewing all of my exam while sleeping.
Other times I may forget part of the question while I'm answering it. I may have already answered the "interesting" (to me) part of the question, and then I (unconsciously) lose interest on the rest of the question, maybe because the rest of it is very obvious, or some other reasons...
The conclusion I got for myself after so many years of repeating these things, is that it's not a problem. I simply can't concentrate my attention on things that don't really interest me, but I can concentrate exceptionally on things that I like. So, OK, I can live with that, I'll simply accept it, and try to continue working on things that attract me, and avoid those that don't. I can make a very good profit of that ability of mine to live. And in the end, not everyone can do what everyone else does; trying hard to "fix" it is probably only going to bring unhappiness, because there's nothing to be fixed.
What I'd do with this kid if I were a teacher, I'd make as much of an exception as I can (as much as the laws allow), and grade him according to the understanding of maths that he shows in reality, and not just in the exams.
As per myself, I had to change schools when I was 12 due to this. Later on I continued getting much lower grades in high school and university than I could have gotten (still had quite good ones), and even in the end I didn't finish my degree because of 1.5 ECTS (out of 240 ECTS) because I lost interest in it. And have I had any serious problems due to that? Nope; I'm very happy, and have had very good jobs. Even if he may have the same problems in the future, I'd just not try so hard to fix them, or at least not so hard that it demotivates him to do what he likes. Specializing is not bad; in fact it's a good thing, IMO.