Recorded in the Ming-dynasty work
蠡海集 by
王逵: the term originally came from astrology. The 60-year sexagenary cycle was divided into yang stems and yin stems, and when calculations slipped between the two you had
阴错阳差, yin-yang astronomical errors. The cosmic mismatch became a metaphor for everyday flukes.