In the chiral symmetric phase, the polarized instanton-anti-instanton molecule pairing induces a nontrivial repulsive interaction in the iso-scalar axial-vector channel. As a consequence, one unusual property is observed that in the chiral restoration phase, there is a first order phase transition for the spontaneous generation of local CP violation and chirality imbalance. Furthermore, it is found that external magnetic fields will lower the critical temperature for the local CP-odd phase transition and catalyze the chirality imbalance, which destroys the chiral condensate with pairing quarks between different chiralities. A reasonable strength of the repulsive interaction in the iso-scalar axial-vector channel can naturally explain the inverse magnetic catalysis around the critical temperature under external magnetic fields.