Many accomplished mathematicians were not professional mathematicians. Surprisingly enough, many were in fact lawyers.
Descartes was himself a lawyer (by training) then there were Leibnitz, Cayley, Viete. If you include Physics you will get a bigger list.
Descartes and Fermat ran a mutual admiration society, don't read to much into it.
Both had independently come up with coordinate geometry, linking algebra and geometry
I agree Fermat probably had a wrong proof but curb your condescension towards lawyers making contributions in mathematics.