You didn't have 20k trees, you had less. The game "gave you" the trees from the boat race twice, but knew behind the scenes you really only had half that, so when you tried to trade them in it crashed.

The first time I did that it showed me that boat race message again and gave me the fake trees again... so I crashed again.

Next time in, I only had 10k trees and it let me buy gold without a problem. Lot of headache to work around their distribution bugs.