The template includes private copies of standard packages and standard fonts which makes very little sense, and if you use it with texlive 2023 it stops with
) (./listings.sty
(/usr/local/texlive/2023/texmf-dist/tex/latex/listings/lstmisc.sty
***
*** This file requires `listings.sty' version 1.9.
*** You have a serious problem, so I'm exiting ...
***
If you delete the version of listings.sty
in the template, the supplied wileyNJDv5_AMA.tex
does run without error with both pdflatex and lualatex
but with several warnings and ending with
(\end occurred when \iftrue on line 4824 was incomplete)
(\end occurred when \if on line 4812 was incomplete)
(\end occurred when \if on line 4800 was incomplete)
(\end occurred when \if on line 4788 was incomplete)
(\end occurred when \if on line 4776 was incomplete)
(\end occurred when \if on line 4764 was incomplete)
(\end occurred when \if on line 4752 was incomplete)
(\end occurred when \if on line 4740 was incomplete)
(\end occurred when \if on line 2 was incomplete)
However as a commercially supported class, it's not reasonable to debug it, I would just use it as is if they are requiring that, but complain to the publisher and ask that they provide an example document that runs without warning.