Hello, a friend sent me this clip where he loses gold for no reason, could someone decipher the cause or if it is a rare bug?

Could be a visual bug, since it looked like, it only happens when they are gathering.
`Maybe some sync issue but i doubt that the most.
I´d love to have a replay of games where that happens