While I highly doubt the exam had anything to do with it and was clearly just coincidence I think its also obvious the migraines are real.
I cant imagine why the first doctor wouldnt treat the migraines while politely pointing out the exam is unrelated.