This is a very old bug of amsart.cls
that I appear to have analyzed back in 2007 in a comp.text.tex thread.
Here are the relevant lines in amsart.cls
, where the error is apparent on line 495:
480 \newcommand\contrib[2][]{%
481 \def\@tempa{#1}%
482 \ifx\@empty\@tempa
483 \else
484 \ifresetcontrib \@xcontribs
485 \else \global\resetcontribtrue
486 \fi
487 \fi
488 \ifx\@empty\contribs
489 \gdef\contribs{#1 #2}%
490 \else
491 \g@addto@macro\contribs{\and#1 #2}%
492 \fi
493 \@wraptoccontribs{#1}{#2}%
494 }
495 \def\wraptoccontribs#1#2{}
The correct code should be
495 \def\@wraptoccontribs#1#2{}
The macro is just a hook, possibly used for some in-house processing if the paper is to be inserted as a contribution to some volume.
The workaround is adding
\makeatletter
\let\@wraptoccontribs\wraptoccontribs
\makeatother
to the document preamble.
\documentclass{amsart}
\makeatletter
\let\@wraptoccontribs\wraptoccontribs
\makeatother
\begin{document}
\title{title}
\author{names}
\contrib[With an appendix by]{sb}
\maketitle
content
\end{document}

\makeatletter\let\@wraptoccontribs\wraptoccontribs\makeatother
to your preamble lets you compile. I found this here. – Max Jul 3 '18 at 8:42amsart
does appear to have a\contrib
command, as described in the documentation (page 20) – preferred_anon Jul 3 '18 at 8:48