If $E/F$ is a quadratic extension $p$-adic fields, we first prove that the $\mathrm{SL}_n(F)$-distinguished representations inside a distinguished unitary L-packet of $\mathrm{SL}_n(E)$ are precisely those admitting a degenerate Whittaker model with respect to a degenerate character of $N(E)/N(F)$. Then we establish a global analogue of this result. For this, let $E/F$ be a quadratic extension of number fields and let $\pi$ be an $\mathrm{SL}_n(\mathbb{A}_F)$-distinguished square integrable automorphic representation of $\mathrm{SL}_n(\mathbb{A}_E)$. Let $(\sigma,d)$ be the unique pair associated to $\pi$, where $\sigma$ is a cuspidal representation of $\mathrm{GL}_r(\mathbb{A}_E)$ with $n=dr$. Using an unfolding argument, we prove that an element of the L-packet of $\pi$ is distinguished with respect to $\mathrm{SL}_n(\mathbb{A}_F)$ if and only if it has a degenerate Whittaker model for a degenerate character $\psi$ of type $r^d:=(r,\dots,r)$ of $N_n(\mathbb{A}_E)$ which is trivial on $N_n(E+\mathbb{A}_F)$, where $N_n$ is the group of unipotent upper triangular matrices of $\mathrm{SL}_n$. As a first application, under the assumptions that $E/F$ splits at infinity and $r$ is odd, we establish a local-global principle for $\mathrm{SL}_n(\mathbb{A}_F)$-distinction inside the L-packet of $\pi$. As a second application we construct examples of distinguished cuspidal automorphic representations $\pi$ of $\mathrm{SL}_n(\mathbb{A}_E)$ such that the period integral vanishes on some canonical copy of $\pi$, and of everywhere locally distinguished representations of $\mathrm{SL}_n(\mathbb{A}_E)$ such that their L-packets do not contain any distinguished representation.