I recently learned that there is more to migraines than just the headache. It has four or five stages, but not every migraine goes through every stage. At any rate, the last stage, postdrome I think it is called, often includes symptoms that effect mood and focus.
If I recall, some common (and even some uncommon) things that occur after a migraine headache can be:
fatigue
lowered intellect
mood shifts (either depression or elation)
poor comprehension and concentration
If one combines lowered intellect with poor concentration, memory loss seems reasonable to me.
I've always been scatter brained even before I began to be a frequent migraine sufferer, so I never attributed forgetting things to them.
Try searching for 'phases of a migraine'. I've seen some who argue there are four distinct phases to a migraine, while others claim there is five. Nonetheless, there's a lot more going on than just a nasty headache. It is worth looking up when you have the time and clarity of mind.
I also get migraines which start at the back of my neck and go up to the very top of my head. Mine last a couple days by the time they are totally gone. i cannot take migrane meds because of all the other medication I take. I take opiod painkillers for my condition so that's what I use for my migraines but it takes quite a while to work. I don't finish sentences and can't remember words but because I have fibromyalgia, they call it fibro fog.
I think I share your real concern as not remembering your child's name sometimes can be very worrisome. It might just be worth a trip tp your ER! If iy ends up that its not of any concern, then, that's great but what if there's more to worry about. I hope I haven't scared you, just telling you what I would do.
I wish you good luck and good health!