The following minimal example produce the typical "Something's wrong--perhaps a missing \item" error. I can't understand what's wrong with loading xgalley together with the use of \addvspace...

\documentclass{article}

\usepackage{xgalley}

\makeatletter
\newenvironment{test}
{\par}
{\par
%\@endpetrue
}
\makeatother
\begin{document}

\begin{test}
abc
\end{test}

\end{document}


Adding \@endpetrue didn't help, as suggested in \addvspace{x}\noindent ... \addvspace{x} doesn't work.

The above example can be made smaller by just making a call to \addvspace rather than placing it in an environment.

The reason xgalley is considered experimental, and can't be loaded in documents in general, is that it only works with constructs that are specifically designed or modified to work with it. The entire mechanism for vertical mode material is different from the LaTeX2e one. Currently, \addvspace isn't modified to work with xgalley so an error is unsurprising. A fix at least covering the normal us case is
\ExplSyntaxOn