I fell like you should get more xp regardless of turning the chest in. If someone attacks you and takes your loot, you should lose all the gold. Should you not get credit for at least finding the chest though, for figuring out the riddles or map. That way if you spend two hours on a voyage and get attacked, at least it wasn't all a waste.
(I edited the heading in agreement with the commenters. XP based on voyage completion instead of turning in. Gold reward however should only be with turning it in. These two things don't have to go together. That way if we get looted, all of our two hour voyage isn't completely lost)
Update about realism:
Although most people seem to agree with me, a few of you are arguing about realism. Keep in mind this is a game and as such should be enjoyable. Many games reward the player for doing lots of task regardless of turning in a quest, most rpg games specifically. There is nothing wrong with rewarding the player for doing things. How realistic is it that I can eat bananas while swimming under water in Sea of Thieves to keep from drowning. It logically doesn't make any sense yet I am glad they did it to make the game more enjoyable so you don't die every time you explore a ship wreck.