When you write \pdfpagewidth=17in or \pdfpagewidth=\normalpdfpagewidth you're assigning one length or dimension to another length or dimension. That's the syntax used for such assignments <lenA>=<lenB> (the = is optional) and copies the length of <lenB> into <lenA>. If <lenB> changes after the assignment, <lenA> still holds the original length of <lenB>.
In your case, you're \defining some control sequence (or macro) to represent the length, as in \def<csname>{<stuff>}. And since TeX doesn't naturally expand its control sequence until its set on paper, any change in <stuff> is carried with <csname>. You either want the expanded version of the length (as mentioned by muzimuzhi)
\edef\normalpdfpagewidth{\the\pdfpagewidth}
or assign the lengths in a more natural way:
\newlength{\normalpdfpagewidth}
\setlength{\normalpdfpagewidth}{\pdfpagewidth}

\documentclass{article}
\newlength{\normalpdfpagewidth}
\begin{document}
Normal page
\setlength{\normalpdfpagewidth}{\pdfpagewidth}
\clearpage \setlength{\pdfpagewidth}{17in}
Wide page
\clearpage \setlength{\pdfpagewidth}{\normalpdfpagewidth}
Normal page again
\end{document}
\pdfpaperwidthis a dimension, hence to store it's value you'll need\edef\normalpdfpagewidth{\the\pdfpagewidth}. – muzimuzhi Z Nov 12 '21 at 06:19