You're partly correct. A 2011 study found that participants subjectively rated the noise as more unpleasant if they were aware it was nails on a chalkboard (others were told it was a sample pulled from contemporary music), but it still produced a physical response either way. It also wasn't the higher frequencies of the noise that created the effect, but the roughness and volume of noise in the 2000 to 4000Hz range. The human ear is particularly sensitive to that range of frequencies, so it's probably not only a learned reaction.That certainly leads me to one of my personal unpopular opinion: Nails on a chalkboard and many other screechy or "cringe worthy" sounds do not really bother me. They are not disturbing, they do not give me chills nor do they make the hair on the back of my neck stand up.
I honestly believe that 75% of the people who say they do not like those sounds are lying and just trying to "fit in" or something like that.
Anyway, I had no preconception of pencil lead being able to make such a noise. It actually bothers me more than scratching a chalkboard; it was just an easy way to explain the effect.