Earlier quoted context omitted.
The answer is in your question. It's the credentialing. The pediatrician lacks the credentials of a neurosurgeon. Just as non-doctors lack the credentials to work as a doctor. The hosptial, insurance, and court would all be looking at the credentials.
Credentials are not the same as license. For example, software engineers do not need to pass any certification exams to practice software engineering, but companies still look at their education, years of experience, etc... Yes, it would make a recruitment process for doctors longer, as you would have to interview them, ask them questions to verify their medical knowledge, etc., but it is not impossible.
Licensing is merely a subset of the larger credentialing world. Even in your doctor example, the license is not the issue - board certification of a specialty would be the issue.