You definitely need both.
We hired a specialist for a specific technical problem. I told management that he was great for this, but never let him work with people. Five reorgs later, they put him on the help desk and fired him within two weeks.
I, as a generalist, never had a computer project fail from 1969 to retirement in 2016. I built a relational database and my own memory swapping routines for my first project, a linear program system, on an IBM 360 with 64-k (0.000000064 gig) of memory.
Three years later, the Chief Actuary said, “Usually we have someone who passed 7 exams work on this project. All we have is you. If you make a mistake, and we don’t catch it, the company could be bankrupt.” Nice way to start a project.
My last position before retirement was with a publisher writing software to collect and analyze data daily. One editor said, “I didn’t know how spoiled I was until you were out.”
I always made it my job to understand my user’s jobs — with no preconceptions.