$解:由题意得\begin{cases}x+y-2024≥0\\2024-x-y≥0\end{cases}$
$∴x+y=2024$
$∴\sqrt{3x+y-z-8}+\sqrt{x+y-z}=0$
$又∵\sqrt{3x+y-z-8}≥0,\sqrt{x+y-z}≥0$
$∴\begin{cases}3x+y-z-8=0\\x+y-z=0\\x+y=2024\end{cases} 解得\begin{cases}x=4\\y=2020\\z=2024\end{cases}$
$∴(z-y)^2=(2024-2020)^2=16$