That's really interesting, I had no idea they'd intersected in this strange way. Although Dick was likely suffering from mental illness and Lem's critique of him seems like a writer's version of the the not-entirely-uncommon 'great ideas, terrible writing'.
http://english.lem.pl/faq#P.K.Dick
Unless you consider it flattery that he told the FBI that "Lem is probably a composite committee rather than an individual".
But the lack of respect was not mutual!
Stanislaw Lem: Philip K. Dick: A Visionary Among the Charlatans
https://www.depauw.edu/sfs/backissues/5/lem5art.htm