The error happens at line 58 of xyidioms.tex; let's look at it
43 \ifx\AtEndDocument\undefined
44 \expandafter\ifx\csname amsppt.sty\endcsname\relax
45 \let\xysetup@@=\xysetup@dummy
46 \else
47 \def\xysetup@@#1{%
48 \expandafter\def\expandafter\topmatter\expandafter{\topmatter
49 #1\xyuncatcodes}}\fi
50 \else
51 \def\xysetup@@#1{\AtBeginDocument{#1\xyuncatcodes}}
52 \fi
53 \ifx\xysetup@@\xysetup@dummy\else
54 \xysetup@@{\let\xysetup@@=\xysetup@dummy \xyuncatcodes}\fi
55 \xywarnifdefined\xyclosedown@@
56 \ifx\AtEndDocument\undefined \let\xyclosedown@@=\eat@
57 \else \def\xyclosedown@@#1{\AtEndDocument{#1}}\fi
58 \xylet@\xy@begindvi=\literal@
The conditional at line 43 returns false, so
\def\xysetup@@#1{\AtBeginDocument{#1\xyuncatcodes}}
is performed. Since now \xysetu@@ is not the same as \xysetup@dummy,
\xysetup@@{\let\xysetup@@=\xysetup@dummy \xyuncatcodes}
is executed. Unfortunately, inside \standalonepreambles, the macro \AtBeginDocument is redefined to immediately deliver its argument, as this interactive run shows
(/usr/local/texlive/2015/texmf-dist/tex/generic/xypic/xyidioms.tex
! Undefined control sequence.
l.58 \xylet
@\xy@begindvi=\literal@
? i\show\AtBeginDocument
> \AtBeginDocument=\long macro:
#1->#1.
<insert> \show\AtBeginDocument
l.58 \xylet
@\xy@begindvi=\literal@
?
This means that the \xysetup@@ command makes TeX into executing \xyuncatcodes at the spot. This performs, among other things, \makeatother. So now @ is not a letter any more.
Line 55 prints two @ characters, but we're already after \begin{document}, so there's nothing wrong. The following conditional returns false and defines \xyclosedown rather than \xyclosedown@@ but this raises no error. Now line 58 has the tokens
\xylet•@•\xy•@•b•e•g•i•n•d•v•i•=•\literal•@
(• is used to separate the tokens). Since \xylet is not defined, the error is raised.
Conclusion: it can't work. Any package that performs category code changes of @ at \AtBeginDocument will fail similarly.
@is not set properly.;-)– egreg Apr 08 '16 at 17:06