Simply put, the following does not compile:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{figure}
\caption{
poly\nobreakdash-Si
}
\end{figure}
poly\nobreakdash-Si % move this to before figure caption and it works
\end{document}
but, as noted in the code comment, if the command has been used in the body of the document before its use inside the figure caption it does compile (and produce the desired result, in a more complicated example).
Why does this happen?
The error message is ! Argument of \@tempb has an extra }. I have tested this with pdflatex and lualatex in TeX Live 2017 and 2020.
\nobreakdashneeds to be "protected" in a moving argument:\caption{poly\protect\nobreakdash-Si}. It's possible to define\nobreakdashin a way that doesn't require this, but the definition is an old one and hasn't been upgraded. – barbara beeton Apr 30 '20 at 18:45