The phrase "habitual residence" determines which country is responsible for child protection. I am not aware of any country that makes as many absurd decisions as England. Most other countries make decisions that are about what is best for the child rather than what is best for the local authority targets.
If the parents are "habitually resident" in another country when the baby is born then the authorities here do not have any legal power to take the child. That did not stop them in the linked case, but at least the High Court got the law right even if the lower court did not.
Congratulations are due to Brendan Fleming Solicitors for fighting the case properly.