I have the following code:
usepackage{subfigure,subcaption,caption}
\begin{figure}[H]
\centering
\begin{subfigure}{0.32\textwidth}
\centering
\includegraphics[height=1.2in]{Canada.png}
\caption{Canada}
\end{subfigure}
\begin{subfigure}{0.32\textwidth}
\centering
\includegraphics[height=1.2in]{US.png}
\caption{United States}
\end{subfigure}
\begin{subfigure}{0.32\textwidth}
\centering
\includegraphics[height=1.2in]{UK.png}
\caption{United Kingdom}
\end{subfigure}
~
\begin{subfigure}{0.32\textwidth}
\centering
\includegraphics[height=1.2in]{China.png}
\caption{China}
\end{subfigure}
\begin{subfigure}{0.32\textwidth}
\centering
\includegraphics[height=1.2in]{India.png}
\caption{India}
\end{subfigure}
\begin{subfigure}{0.32\textwidth}
\centering
\includegraphics[height=1.2in]{Brazil.png}
\caption{Brazil}
\end{subfigure}
\caption{2010 - 2016\\ source: \citep{source}}
\end{figure}
which gives the following error in line with the \begin{subfigure}...: "Missing number, treated as zero. Illegal unit of measure (pt inserted). I can't for the life of me understand whats wrong as I copied this from a previous project I created and just placed different graphics and added 2 more and changed the measurement of each subfigure to {0.32\textwidth} from the prior {0.45\textwidth}. Is there something functionally different about using 6 figures rather than 4? I don't see why there would be

subfigureand thesubcaptionpackage are not compatible with each other. You should get an error message informing you about this. To fix this, remove thesubfigurepackage from your preamble. – leandriis Mar 12 '20 at 19:43