It might by a bug. I made same changes to the \uplevel
command to make it work.
Using Document Class: exam 2021/02/26 Version 2.7
\documentclass{exam}
\usepackage[utf8]{inputenc}
\usepackage{showframe}
\makeatletter
\long\def\uplevel#1{% changed <<<<<
\saved@totalleftmargin=\leftskip
\par\bigskip
\leftskip=\@totalleftmargin
\advance\leftskip-\leftmargin
\advance\@totalleftmargin-\leftmargin
\advance\linewidth\leftmargin
#1%
\advance\linewidth-\leftmargin
\advance\@totalleftmargin+\leftmargin
\leftskip=\saved@totalleftmargin
\nobreak
}
\renewenvironment{EnvUplevel}
{\saved@totalleftmargin=\@totalleftmargin
\par\bigskip\bgroup%
\leftskip=\@totalleftmargin
\advance\leftskip-\leftmargin
\advance\@totalleftmargin-\leftmargin
\advance\linewidth\leftmargin
}
{\egroup\@totalleftmargin=\saved@totalleftmargin\nobreak}
\makeatother
\begin{document}
\begin{questions}
\question The apples and oranges say it takes two to tangarine.
\begin{parts}
\part[5] The \textbf{bananas} have come to say hello! \verb|\fillwithlines{\stretch{1}}|
\uplevel{
\fillwithlines{\stretch{1}}
}
\part[15] The \textbf{pears} have come to say hello! \verb|\fillwithlines{\stretch{1}}|
\begin{EnvUplevel}
\fillwithlines{\stretch{1}}
\end{EnvUplevel}
\part[25] The \textbf{grapes} have come to say hello! \verb|\fillwithlines{3cm}|
\begin{EnvUplevel}
\fillwithlines{3cm}
\end{EnvUplevel}
\end{parts}
\end{questions}
\end{document}