Later in the turn I wanted to spend some gold to upgrade production and I was 7 gold short of the unit I wanted. So I went back to the boat I upgraded (it was still on the dock) and I downgraded it. However I didn't get my 10 gold back but my boat was downgraded

Now I realize you don't want players upgrading, sailing to another dock and then downgrading and getting their money back. But downgrading before moving should give your money back or at the very least should be impossible to prevent accidentally downgrading hoping to get your gold back then realizing you don't and having to upgrade again paying the cost twice.
KGB