反面教師(はんめんきょうし)

Japanese vocabulary

Meaning: bad example from which one can learn; good example of what not to do (esp. how not to behave); negative example

See it used in real works