I apologize if anyone already talked about this but I just thought of it today.
I have theory which could possibly make both stoties of how Jack obtained his compass true. In young Jack Sparrow book series Jack is trying to make a life for himself not as pitate but as ordinary sailor. It wasn't until tenth book, "Sins of the Father, that he begans giving thoughts to pirate life. Jack is supposed to be around fifteen years old in these books. In flash back of "Dead men tell no tales" he is eighteen. My theory is that after the events of Young Jack Sparrow books he did give a shot to pirates life but he still deep down wanted to make an honest living. Enter "Price of freedom" book. In it Jack rans away from Shipwreck cove at twenty years old and becomes a sailor for EITC. My theory is that in order to do so without fetting notice like last time, Jack asked Tia Dalma for help, and used compass as paynment. Her actually being a sea goddess knew that Jack isn't made for life of ordinary sailor and that he will be back (therefore he wasn't giving a compass away forever like when he traded it for rum), so she kept it same. When Jack did return to life of piracy he bought compass back from Tia Dalma. This is just my theory. I would like to hear what you think about it.