I am working with overleaf, and the following code:

\documentclass{amsart}
\usepackage{glossaries-extra}

\begin{document}
\tableofcontents

\section{Sample}

\end{document}


will give the following output:

Insert \glsxtrRevertMarks or \glsxtrRevertTocMarks in your preamble.