I think that was a core plot point of a series of books by Niven I think. Humans are on a planet that has almost no phosphorus or maybe potassium in it's biosphere. Humans have to take it artificially by sprinkling a special salt on every meal. But it's very limited and expensive and so a significant part of the population are mentally handicapped to lesser or greater degrees, generation after generaion.
Ah, Destiny's Road, and it was Potassium.
"...dooming humanity to a slow mental extinction."
Great.
There was also Black Destroyer by a.e. Van vogt, where the cat-like creature specifically ate phosphorus: https://scifi.stackexchange.com/questions/153274