a relevant point: "In 1847, Gabriel Lamé outlined a proof of Fermat's Last Theorem based on factoring the equation $x^p + y^p = z^p$ in complex numbers, specifically the cyclotomic field based on the roots of the number 1. His proof failed, however, because it assumed incorrectly that such complex numbers can be
factored uniquely into primes, similar to integers. This gap was pointed out immediately by Joseph Liouville, who later read a paper that demonstrated this failure of unique factorisation, written by Ernst Kummer.