Phonosemantic compound. 金 represents the meaning and 昔 represents the sound. The character is based on the original meaning "grind stone", which later shifted to "mix", "be in disorder", and "wrong".
error, blunder, mistake, wrong; mistake; wrong; bad; interlocking; complex; to grind; to polish; to alternate; to stagger; to miss; to let slip; to evade; to inlay with gold or silver