I've seen this answer, but it didn't solve the errors. My LaTeX document compiled fine on a Springer Nature template and even on another IEEE template. Oddly, this conference template is where these odd errors show up. I've tried copying lines 545 to 567 into GEdit to get rid of any unwanted invisible characters, and copied it back to TexMaker, but the errors still show up. Tried using the same template on OverLeaf, and errors show up there too.
Is this a problem with the conference template itself?
Algorithm generated:
Despite the errors, the PDF is generated, and the algorithm appears like this:

There is an unwanted =0 at endfunction and plenty of zeroes at the side.
The packages used:
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
%---user defined packages start
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{subfig}
\usepackage[latin9]{inputenc}
\usepackage{float}
\usepackage{mathtools}
\usepackage{algpseudocode}
\usepackage{csquotes}
\usepackage{balance}
\usepackage{verbatim}
\usepackage{multirow}
\usepackage[none]{hyphenat}
%---user defined packages end
The code:
%----------------------------------------------------
\begin{algorithm}[tbp]
\caption{Fitness Landscape Generation\label{alg:fitnessLandscapeGeneration}}
\begin{algorithmic}
\Function{Calculate-Point-XYZ}{$S$}
\State $z=\sum_{i=1}^{i=n}f_{i}$, $x=0$, $y=0$, $p=9\times9$
\State $\theta=0$, $d=360/p$
\For{each {$I$}}
\For{each number $n$ in cells of $I$}
\State $\theta=\theta\times\pi/180$
\State $t_{x}=x+n$, $t_{y}=y$
\State $a_1=\sin(\theta)$, $a_2=\cos(\theta)$
\State $x=a_2\times(t_{x}-x)-a_1\times(t_{y}-y)+x$
\State $y=a_1\times(t_{x}-x)+a_2\times(t_{y}-y)+y$
\State $\theta=\theta+d$
\EndFor
\EndFor
\Return $x$, $y$, $z$
\EndFunction
\end{algorithmic}
\end{algorithm}
%----------------------------------------------------
Other anomalies:
Even other parts of the paper are appearing odd, when it compiles and appears fine in other templates.
Whether I use \begin{description} or \begin{itemize} the contents of
\item [\textbf{Cardinality}:] The number of elements in a set is the cardinality
of the set. For example, the phrase ``the number of $F_{i}$ cells
is two'' is denoted mathematically as: $\left|F_{i}\right|=2$.
end up with overlaps. So I assume this is a problem with the template, and I'd be better off using some other template?

\usepackage[latin9]{inputenc}(I do not think it is possible to use latin 9 on overleaf) – David Carlisle May 31 '23 at 13:40algorithmic, but perhaps OP knows that, and posted it here as he does not know how to solve it. He seems new to LaTeX, judging from his other questions. – Julia May 31 '23 at 14:39