I read somewhere that the on-gain effect of Mandarin is a bonus, and the action effect is a penalty. I don't think this is good way of thinking of it. They are both just things that happen when you gain or play the card.
As has been pointed out, like many Hinterlands cards, Mandarin can both help you and hurt you. This is clearly true for both effects. If you play some Markets and then two Coppers, you certainly don't want to put those two Coppers back on deck. If you have five Coppers, maybe you do want those back on deck to give you a guaranteed second $5. Obviously if you only use Golds and Silver, usually top-decking these is a good idea.
Again, the action effect can be either good or bad for you. Often putting a gold back can really help your next turn, and you still get the $3. If you happen to be doing well enough to have $8 without the Mandarin, you get a Province this turn, and a Gold in your hand next turn. Of course, sometimes you'd rather not put something back, but sometimes it really helps.
So I think it will take some skill (possibly more than I have at this point) to both buy and play this card well. But both effects can certainly help you if you do it well, and hurt you if you don't.