Without xltabular the numbering is fine:
\documentclass{book}
%\usepackage{xltabular}
\usepackage{longtable}
\begin{document}
\begin{longtable}{c}
\caption{caption}
\endfirsthead
xxx\\xxx
xxx\\xxx
\end{longtable}
\end{document}

If xltabular is loaded (in a current texlive 2024) the counter is increased:
