The Compass Problem

In the newest Pirates movie, we see Jack Sparrow receive his magically endowed compass from his former captain, a compass which would go on to become a major element in the rest of Jack Sparrow's life. The problem is, in Pirates of the Caribbean: Dead Man's Chest, we're told that Sparrow received the compass in a barter with the sea witch Tia Dalma. This appears to be a continuity error, but there's one possible way that it isn't. Perhaps Jack lost the compass after being given it, and then had to barter in order to get it back. Perhaps there's a story there as to how it was lost, that could once again come back to be a problem for Jack Sparrow.