Plot hole

Calypso said Jack got the compass from her; but in Salazar's revenge, the dying captain of the pirate ship gave Sparrow the compass. How come both be true?