I have managed to make it work using the suggestion of @John Kormylo. This is my code:
\begin{figure}[p]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{Scatter_plot_scRNA_spatial.jpeg}
\caption{Total read counts}
\label{scRNA_spatial}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{scatter_spatial_gene_remaining.jpeg}
\caption{Total read counts}
\label{remaining_gene}
\end{subfigure}
\hfill \\
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{scatter_cluster_0_spatial.jpeg}
\caption{scRNA-seq cluster 0}
\label{cluster 0}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{scatter_cluster_1_spatial.jpeg}
\caption{scRNA-seq cluster 1}
\label{cluster 1}
\end{subfigure}
\hfill \\
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{scatter_cluster_2_spatial.jpeg}
\caption{scRNA-seq cluster 2}
\label{cluster 2}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{scatter_cluster_3_spatial.jpeg}
\caption{scRNA-seq cluster 3}
\label{cluster 3}
\end{subfigure}
\end{figure}
\begin{figure}[p] \ContinuedFloat
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{scatter_cluster_4_spatial.jpeg}
\caption{scRNA-seq cluster 4}
\label{cluster 4}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{scatter_cluster_5_spatial.jpeg}
\caption{scRNA-seq cluster 5}
\label{cluster 5}
\end{subfigure}
\hfill \\
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{scatter_cluster_6_spatial.jpeg}
\caption{scRNA-seq cluster 6}
\label{cluster 6}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{scatter_cluster_7_spatial.jpeg}
\caption{scRNA-seq cluster 7}
\label{cluster 7}
\end{subfigure}
\hfill \\
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{scatter_cluster_8_spatial.jpeg}
\caption{scRNA-seq cluster 8}
\label{cluster 8}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{scatter_cluster_9_spatial.jpeg}
\caption{scRNA-seq cluster 9}
\label{cluster 9}
\end{subfigure}
\caption{Scatter plots of gene read counts in Visium and scRNA-seq data (a). Read counts of genes expressed only in Visium data (b). Scatter plots for gene read counts in each cluster of scRNA-seq and in Visium data (c, d, e, f, g, h, i, j, k, l).}
\label{scRNA clusters}
\end{figure}
\edef\specialpage{\the\numexpr \value{page}+1}
\AddToHook{shipout/after}{\ifnum\value{page}=\specialpage\relax
\thispagestyle{empty}
\fi}
}
\AddToHook{shipout/background}{...}
.