Example: Timmy and Tammy, the twins from Hell, were actually as good as gold when they visited their Grandparents, and didn’t end up killing them as was widely predicted.
The meaning of good as gold has altered somewhat since its inception. We now use it exclusively for describing behaviour, but originally it meant that something was genuine. Bank and credit notes were often eyed with suspicion, as they were open to counterfeiting, and were only a promise of payment, rather than payment itself. Silver and gold coins were more readily accepted, being of tangible value, and a comforting weight in the hand.
Why the focus moved from the lustre of precious metals to the behaviour of children appears unclear.