Talking about the "nervous system" in isolation from the rest of the body and its environment is like trying to figure out what is the automobile about by looking at its motor running on a stand. You need to look at where the "rubber hits the road" to really understand what's going on.
Only "bodies can do things" not the isolated nervous systems. Of course, brains have a #function within the body, the same way that individual bodies (with their respective brains) have a function within a social organization.
The nervous "(sub)system" has no need to be in direct contact with the environment, but it also can't function or even survive (is not viable) without the support of all the other body parts, some of which *are* and *must* be in direct contact with the #environment.
According to #HH_Pattee, The whole purpose of the nervous system and cognition is the survival of the body:
>"The major function of the brain is actually not to sit around and discuss things like we are doing now, but it is to make decisions - it has to decide whether to fight or run or eat ..."
https://www.academia.edu/6576779/Rosen_and_Pattee_on_Theoretical_Biology
Thinking about the nervous "system" in isolation is typical for #Cybernetics thinking which separates the #control (management) system from the #controlled system (the plant) and does not recognize the fact that they depend on each other and should be thought of as one system.
People are "social animals" and the emergent capability and knowledge of an #organization as a system of people are quite different from the collection of all the individual learning capabilities and knowledge of the individuals it is composed of, so it is, therefore, appropriate to treat the organization as another dynamical #learning system.