We know that Parashurama was the guru of Bhisma, a kshatriya. Then why did he refuse to teach Karna on the basis of being a kshatriya?
After eliminating Kartavirya Arjuna and his sons of Haihaya tribe and all Kshatriya rulers of that period, Parasurama left the enmity with Kshatriyas.
Hence, as he did not have grouse against Kshatriyas, he taught all secrets of using weapons to Devavrata (Bhishma).
However, after his defeat at the hands of Bhishma, in the Amba's episode, he perhaps, thought not to teach the knowledge of weapons to Kshatriyas. That is why he taught all the secrets to Drona alone.
In the case of Karna, he introduced himself to be a brAhmana and got the knowledge of all the weapons from Parasurama.
'I am a Brahmana of Bhrigu's race.' This procured honour for him.
However, it was later found by Parasurama that Karna could endure pain like a Kshatriya, so he got doubt , which was later confirmed that Karna to be a non-brahmin.
It was the lie that Parasurama could not tolerate and thus, he cursed Karna.