This seems like a very shocking idea. But up to the 1950's this was the majority opinion of the medical profession. They thought that newborns did not have the necessary thalamo-cortical connections to register pain. As a consequence, surgical operations like circumcision were routinely performed on newborns without anesthesia.
Today we know that babies who have been circumcised without anesthesia have a higher chance of having psychological problems as teenagers. Presumably the stress of circumcision had a long-lasting effect on the bodies and minds of the developing organism.
But does that mean that the babies felt the pain at the time of the operation?
What do we mean by "feel"?
When a normal adult human says they feel something, they mean more than just that their body is reacting. They mean that they, as persons, feel it. They, as persons with a sense of "I", know how their bodies are reacting and how they might take account of what's going on.
But if there is no person present, then there is no feel. For example, if a normal adult is engaged in some attention-demanding activity, so they as persons are not paying attention to an injury, then they will at that moment not feel the pain. Many people have sustained injuries during sporting events without noticing it until afterwards.
When the person is absent, there's no feel.
Anybody in the cockpit?
Now what about babies? Presumably newborn babies do not yet have the concept of "I". Who then would be paying attention and feeling the pain? There's nobody in the cockpit.
So in the normal sense of the word "feel", as used by adults, it seems that babies can feel no pain. Their bodies react, their brains react, but they as persons are not yet there to feel the pain.