I'm sorry you go through this and can rely.
My husband is also highly intelligent and at the same time missing common sense.
We went through exactly the same shopping behavior (buying what brands he felt like or loosing the list).
Once, we had guests over for dinner and he went upstairs to pickup something he just bought and wanted to show. We were all chatting and at first didn't noticed he didn't come back. After a while (like 30 minutes), I went to check on him. He was on pyjamas, programming on his computer: he had had an idea for a program he was working on, began to test it and forgot we had guests! I was mortified!
We sat down and talk about his distraction to find solutions.
With time and experience, we both now know that when he has a stress about some problem he needs to solve (whether a computer program or a personal issue), this problem takes over his normal thinking. He can wake up at 2 am because he found a solution/idea to try. He can forget guests in the middle of a dinner in our own place, chatting loud enough to be heard from his desk. His entire focus and attention is towards the problem/solution and the rest of the world vanishes.
He has been like that for ever. In general, I know I can trust him. And, he always sets up reminders for appointments with alarms (being home on time so I can go out goes in his appointment list) in his computer and phone. However, when he works on a hard project, is very busy or especially stressed because he's looking for a solution/idea, he specifically asks me not to leave him alone with the kids. He tells me that at that moment, he may not be able to focus on them as they deserve and I take a baby sitter.
The very distracted/stressful days are the exception, not the rule, and he is great with the kids. But, when he has a problem, I know I will have a silent distracted husband at home (this has lasted for up to one week in a row), so distracted (or better-said,so focus on his task) that he forgets to eat or sleep. In these exceptional moments, I just take care of him, forcing him to come eat and rest. By chance, most of the time, he is just a wonderful husband and dad, focusing his energy on the family.
In my husband case, he was always like that. In your case, it seems "new" and the incident with the baby is a red red flag. His behavior is putting the children at risk. I would list his odd behaviors and show the list to him as the starting point for talking with him (to avoid denial).
Then, talk with him. If you can't discover any "reason" (stress, fatigue, personal issue), then agree that he should see a doctor to rule out medical reasons.
When his problem is personal, my husband usually doesn't talk about it. Either because it's about me or because he doesn't want to worry me. But, he would tell me that something bugs him and that he can't think straight until it's solves.
Best of luck.