Here is a small MWE which creates a warning:
\documentclass[12pt]{book}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{enumitem}
\usepackage{hyperref}
\declaretheorem[name=Theorem,refname={theorem,theorem},Refname={Theorem,Theorem}]{theorem}
\begin{document}
\chapter{Test chapter}
\begin{theorem}
\label{ABCtheorem}
\begin{enumerate}
\item s
\end{enumerate}
\end{theorem}
Theorem~\ref{ABCtheorem}
\end{document}
Compiling with Overleaf, the log file states that
pdfTeX warning (dest): name{theorem.1} has been referenced but does not exist, replaced by a fixed one
This is confusing. The only reference that I have is ABCtheorem which is exactly the same in \label{ABCtheorem} as it is in \ref{ABCtheorem}. According to the answer by Poeh, adding \hspace{2em} after \label removes the warning (and indeed it does). As does adding (any) text such as xyz after \label. And here, only ASCII characters are used.
But I would prefer to avoid adding unjustified snippets if possible. Is the problem that enumerate and \label are the only things inside theorem, and that this is 'incorrect'?
Addendum
Replacing \label with \hypertarget and \ref with \hyperlink also gives no warning.
\documentclass[12pt]{book}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{mathtools}
\usepackage{enumitem}
\usepackage{hyperref}
\declaretheorem[name=Theorem,refname={theorem,theorem},Refname={Theorem,Theorem}]{theorem}
\begin{document}
\chapter{Test chapter}
\begin{theorem}
\hypertarget{ABCtheorem}{}
\begin{enumerate}
\item s
\end{enumerate}
\end{theorem}
Theorem~\hyperlink{ABCtheorem}{1}
\end{document}
hyperref! – Linear Christmas Feb 15 '23 at 17:52