[Tex/LaTex] Counter too large ERROR when it shouldn’t

subfloats

My Latex document suddenly stopped compiling and raising the "! LaTeX Error: Counter too large." error for no apparent reason. It compiled before, with the same amount of figures and subfigures, but even by erasing the things I added since the last time it compiled, it just doesn't work anymore.

I know what generally causes this error => when captioning more than 26 subfigures, it runs out of letter to label the subfigures and throws this error. This is not my case. My largest figure only has 8 subfigures so I don't know why it doesn't work.

Here's part of my code (more figures come before this):

\documentclass[11pt, oneside]{Thesis} % The default font size and one-sided printing (no margin offsets)

\graphicspath{{./Pictures/}} % Specifies the directory where pictures are stored

\usepackage[T1]{fontenc}
\usepackage{mathtools}  % loads »amsmath«
\usepackage{amsmath}
\usepackage{physics}
\usepackage{float}

\usepackage{tabularx}
\usepackage{adjustbox}
\usepackage[english]{babel}
\usepackage[table]{xcolor}
\usepackage{tabularx}
%\usepackage{showframe} % for demo
\usepackage{lmodern}
\usepackage{microtype}
\usepackage{ragged2e}
\usepackage{lua-visual-debug}

\usepackage{placeins}
\usepackage{multirow}
\usepackage{graphicx} 
\usepackage{caption} 
\usepackage{subcaption}
\usepackage[square, numbers, comma, sort&compress]{natbib} 

\usepackage{booktabs}
%\usepackage[table,xcdraw]{xcolor}

\hypersetup{urlcolor=blue, colorlinks=true} % Colors hyperlinks in blue - change to black if annoying
\title{\ttitle} % Defines the thesis title - don't touch this

\begin{document}

\FloatBarrier
\section{Influence of solid exits}
%compare 5wg and 6wg. REG and SIDE sections, velocity vectors, turbulence, velocity contours?, ... Explain "vortex air-wall" in both, and why it's a clear advantage in 6wg.

\begin{table}[h]
\centering
\hspace*{-2cm}\makebox[\linewidth][c]{%
\begin{tabularx}{1.4\textwidth}{c*{2}{>{\centering\arraybackslash}X}@{}}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_5wg_REG_VV}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_6wg_REG_VV}
        \caption{In-plane velocity vectors [m/s]] - 6-wheels geometry}
        \medskip
    \end{subfigure}     \\
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_5wg_REG_VVz}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_6wg_REG_VVz}
        \caption{In-plane velocity vectors [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_5wg_REG_TANz}
        \caption{Tangential velocity contours [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_6wg_REG_TANz}
        \caption{Tangential velocity contours [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
    &   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_5wg_REG_TURBz}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_6wg_REG_TURBz}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
\end{tabularx}}
\caption{Influence of the solid exits: 5-wheels geometry (left) and 6-wheels geometry (right)}
\label{solid_exits}
\end{table}


\FloatBarrier
\section{Influence of chimneys}
%Chimneys as turbulence creators?
%Chimney diameter? => central reflux! show in both 5wg and 6wg!
%Possible solution => conic chimneys, show with 6wg.

\begin{table}[h]
\centering
\hspace*{-2cm}\makebox[\linewidth][c]{%
\begin{tabularx}{1.4\textwidth}{c*{2}{>{\centering\arraybackslash}X}@{}}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_5wg_REG_VV}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_6wg_REG_VV}
        \caption{In-plane velocity vectors [m/s]] - 6-wheels geometry}
        \medskip
    \end{subfigure}     \\
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_5wg_REG_VVz2}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_6wg_REG_VVz2}
        \caption{In-plane velocity vectors [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_5wg_REG_AXIz}
        \caption{Axial velocity contours [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_6wg_REG_AXIz}
        \caption{Axial velocity contours [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
    &   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_5wg_REG_TURBz2}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_6wg_REG_TURBz2}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
\end{tabularx}}
\caption{Influence of the chimneys: 5-wheels geometry (left) and 6-wheels geometry (right)}
\label{chimneys}
\end{table}

\end{document}

I know I didn't used the most straightforward method to create my tables, and I could have used a minipage for my subfigures instead. But if possible I would like to keep those "tables with subfigures" as they are (with minor changes if necessary to fix the problem ofc).

Best Answer

I get no error and also the reset of subfigure numbering if I remove tabularx, that's probably the cause for the issue.

You simply don't need it just for setting multiple subfigures.

I also changed Thesis to book, as it's impossible to know what class you're loading.

\PassOptionsToPackage{demo}{graphicx} % just for this example
\documentclass[11pt, oneside]{book} % The default font size and one-sided printing (no margin offsets)

\usepackage[T1]{fontenc}
\usepackage{mathtools}  % loads »amsmath«
\usepackage{amsmath}
\usepackage{physics}
\usepackage{float}

\usepackage{adjustbox}
\usepackage[english]{babel}
\usepackage[table]{xcolor}
%\usepackage{showframe} % for demo
\usepackage{lmodern}
\usepackage{microtype}
\usepackage{ragged2e}
\usepackage{lua-visual-debug}

\usepackage{placeins}
\usepackage{multirow}
\usepackage{graphicx} 
\usepackage{caption} 
\usepackage{subcaption}
\usepackage[square, numbers, comma, sort&compress]{natbib} 

\usepackage{booktabs}
%\usepackage[table,xcdraw]{xcolor}
\usepackage{hyperref}

\hypersetup{urlcolor=blue, colorlinks=true} % Colors hyperlinks in blue - change to black if annoying

\graphicspath{{./Pictures/}} % Specifies the directory where pictures are stored

\title{\ttitle} % Defines the thesis title - don't touch this

\begin{document}

\FloatBarrier
\section{Influence of solid exits}
%compare 5wg and 6wg. REG and SIDE sections, velocity vectors, turbulence, velocity contours?, ... Explain "vortex air-wall" in both, and why it's a clear advantage in 6wg.

\begin{table}[htp]
\centering
\makebox[\columnwidth][c]{%
  \begin{minipage}{1.4\linewidth}
  \centering
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_5wg_REG_VV}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry}
        \medskip
    \end{subfigure}\hfill
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_6wg_REG_VV}
        \caption{In-plane velocity vectors [m/s]] - 6-wheels geometry}
        \medskip
    \end{subfigure}     \\
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_5wg_REG_VVz}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}\hfill
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_6wg_REG_VVz}
        \caption{In-plane velocity vectors [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_5wg_REG_TANz}
        \caption{Tangential velocity contours [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}\hfill
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_6wg_REG_TANz}
        \caption{Tangential velocity contours [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_5wg_REG_TURBz}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}\hfill
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_6wg_REG_TURBz}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
  \end{minipage}}
\caption{Influence of the solid exits: 5-wheels geometry (left) and 6-wheels geometry (right)}
\label{solid_exits}
\end{table}


\FloatBarrier\clearpage
\section{Influence of chimneys}
%Chimneys as turbulence creators?
%Chimney diameter? => central reflux! show in both 5wg and 6wg!
%Possible solution => conic chimneys, show with 6wg.

\begin{table}[htp]
\centering
\makebox[\textwidth][c]{%
  \begin{minipage}{1.4\textwidth}
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_5wg_REG_VV}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry}
        \medskip
    \end{subfigure}
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_6wg_REG_VV}
        \caption{In-plane velocity vectors [m/s]] - 6-wheels geometry}
        \medskip
    \end{subfigure}     \\
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_5wg_REG_VVz2}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_6wg_REG_VVz2}
        \caption{In-plane velocity vectors [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_5wg_REG_AXIz}
        \caption{Axial velocity contours [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_6wg_REG_AXIz}
        \caption{Axial velocity contours [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_5wg_REG_TURBz2}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_6wg_REG_TURBz2}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
  \end{minipage}}
\caption{Influence of the chimneys: 5-wheels geometry (left) and 6-wheels geometry (right)}
\label{chimneys}
\end{table}

\end{document}

In the example, I used height=2cm in order not to get too large floats.

enter image description here