Let PA mean the Peano axioms, let Con(PA) mean that the Peano axioms are consistent, and let Incon(PA) mean that the Peano axioms are inconsistent.
Godel's 2nd Incompleteness Theorem says that Con(PA) is not a theorem of PA, unless PA is inconsistent. Now consider the following argument that Con(PA) is a theorem of PA:
(PA and Incon(PA)) implies Con(PA), since (PA and Incon(PA)) is a contradiction, and a contradiction implies anything.
(PA and Con(PA)) implies Con(PA), obviously.
Therefore, [(PA and Incon(PA)) or (PA and Con(PA))] implies Con(PA).
Then since PA is logically equivalent to [(PA and Incon(PA)) or (PA and Con(PA))], we can conclude that PA implies Con(PA).
Therefore, by Godel's 2nd Incompleteness Theorem, PA is inconsistent.
Where is the error? There has to be an error, or else all of mathematics is wrong.