I have two figures (and a table), and while the table references correctly, the two references for figures both display figure 2, but the two captions are figure 1 and figure 2.
\begin{figure}[!bp]
\label{fig:setup1}
\centering
\includegraphics[width=1\linewidth]{figure 1.png}
\caption{Cold and hot water experiment setup}
\end{figure}
.... see Figure \ref{fig:setup1}......
\begin{figure}
\label{fig:setup2}
\centering
\includegraphics[width=1\linewidth]{updated figure 2.png}
\caption{Hot water and ice cube experiment setup}
\end{figure}
..... see Figure \ref{fig:setup2}....




\labelafter\captionin each case. (And always\labelmust go after the thing it labels.) – cfr Mar 29 '24 at 04:09