Maybe they were both devastated, or at the very least in shock, but the clarity of thought isn’t surprising. They were both experienced doctors, capable of detaching emotionally and making difficult decisions quickly in very stressful situations. That is a skill that can be learned.
I can imagine the thought process was: our child is dead - police will be involved - this is going to turn into a criminal case (negligence) - we could lose reputation, livelihoods, even custody of remaining children - could go to prison - so we either take our chances with the Portuguese police - or, as we can’t bring Madeleine back, try to preserve our remaining family and life as best we can. Gerry then hatches the bare bones of a plan to take Madeleine somewhere he can hide her before deciding what to do next.
The accident theory is just a theory (it’s the one Alaverez was working with) and there are others. But all we can say for certain is that after 15 years there is not a single shred of actual evidence found by the Portuguese or the British police or Scotland Yard that points to someone entering that apartment from outside and taking Madeleine. And there is an awful lot of behavioural, witness, DNA and dog evidence that supports the accident cover up theory. I have not yet seen case evidence that supports the theory that either parent killed Madeleine intentionally.