There's nothing I hate more than hauling some loot/skulls to an outpost, and losing those items to some sneaky pirates when they prove to be better at naval combat than I am. I don't miss the gold - this is the Sea of Thieves after all - and they deserve that and the reputation for stealing my stuff. What I hate, is the feeling that the last 1-2 hours of play has been for nothing.
My suggestion to combat this is to reward a TINY amount of reputation towards the Hoarders/Order when you dig up a chest/kill a named skeleton.
When I say "tiny" I do mean tiny. This slight rep gain should be no more than you'd get for handing in a Castaway chest, as I wouldn't want this to be an exploitable system.
If Rare wanted to be conservative about this, they could instead reward a small sliver of reputation whenever a map/riddle/bounty from your quest-dial is completed and removed.
If this was implemented, then when you lose your ship and everything on it, at least your time spent sailing wasn't wasted - the gold is gone but you still progressed your reputations, even if it wasn't by much.
The other option is of course for me to git gud, which I intend to do, but this little rep reward for completing objectives would make me less frustrated while I work on that.