I have quoted John 15:21 and Romans 1:21 from the ESV.
ESV John 15:21 But all these things they will do to you on account of my name, because they do not know (οἴδασιν) him who sent me.
ESV Romans 1:21 For although they knew (γνόντες) God, they did not honor him as God or give thanks to him, but they became futile in their thinking, and their foolish hearts were darkened.
In John 15 the word translated as know is οἴδασιν, and in Romans 1 it is γνόντες. Since I believe Paul would not be teaching something in contradiction to Jesus recorded by John. So the apparent contradiction must arise from not understanding the original languages.
From BLB, a definition for οἴδασιν is:
get knowledge of, understand, perceive
and a definition for γνόντες is:
to learn to know, come to know, get a knowledge of perceive, feel.
After reading these definitions, they seem quite similar and I don't see a difference.