SPOILERS AHEAD (obviously)

I think the prevailing theory as to how Jones returned at the end is that the breaking of the trident and subsequent removing of all curses including Will's binding to the Dutchman would have caused Jones to return because the ship always needs a captain, regardless of whether one is cursed to be that.

My alternate theory is that perhaps it's another instance of Jack's compass animating some of his worst fears. What if his two worst fears were related to the return of two cursed entities: Salazar and Jones? Although he seemed to have forgotten about the former, it still no doubt lingered on subconsciously in his mind, which resulted in his release from the Triangle. And maybe the latter was brought back at the same time but it took some time for him to find the ones who robbed him of his life.

The other more far-fetched theory is that Jack's biggest fears are the return of all his enemies. So we have Barbossa (who returned to Jack's life in some manner), Salazar, and Jones. Maybe Angelica and perhaps Beckett are yet to return to spotlight? I highly doubt that Beckett will ever reappear, just as someone like Sao Feng (also Jack's enemy) definitely won't reappear. Angelica's return is definitely possible, regardless of the compass's doing.