How could I create an environment that wraps a tikzcd (basically a tikz matrix) inside \vcenter{...} while keeping the syntax intact?
What I tried: According to How do I wrap a macro definition in an environment? I need to use environ or NewDocumentComment{+b} (I prefer the later since it seems to be "native" now). But then the environment turns into a macro and I have troubles with & (see Problem with defining shortcuts for TikZ matrices).
/!\ Note that I don't want to change & into \&! So I tried to adapt https://tex.stackexchange.com/a/611535/116348 to environments, but not sure how to do.
MWE:
\documentclass{article}
\usepackage{amsmath}
\usepackage{etoolbox}
\usepackage{tikz}
\usepackage{tikz-cd}
\usetikzlibrary{shapes,shapes.geometric,shapes.misc,positioning}
\NewDocumentEnvironment{vtikzcd}{O{}+b}{
\ensuremath{%
\vcenter{%
\hbox{
\begin{tikzcd}[#1]
#2
\end{tikzcd}
}%
}%
}%
}
\begin{document}
% Ok
\begin{tikzcd}
A & B\
C & D
\end{tikzcd}
% Fails:
\begin{vtikzcd}
A & B\
C & D
\end{vtikzcd}
\end{document}
I tried to define:
\newenvironment{vtikzcd}{
\begingroup% To avoid ampersand issues https://tex.stackexchange.com/a/611535/116348
\NewDocumentEnvironment{tmpZX}{O{}+b}{%
\endgroup%
\ensuremath{%
\vcenter{%
\hbox{%
\begin{tikzcd}[##1]%
##2%
\end{tikzcd}%
}%
}%
}%
}{}%
\catcode`&=13
\begin{tmpZX}%
}{\end{tmpZX}}
but it does not compile.
EDIT
Instead of using \vcenter, I managed to center the diagram appropriately (including one line diagrams) by editing instead the style, using something like:
baseline={([yshift=-.27em]current bounding box.center)},1-row diagram/.style={%
/tikz/baseline={([yshift=-.27em]current bounding box.center)}%
}]
I'm not sure exactly which value I should pick for yshift tought. That said, I'm still interested by this question in case I want later to wrap my environment with any command.

tikz-cdis in general a bad idea because of all the\catcodethings (not only&). I'd say thebaselineapproach is more natural and flexible (in the sense that you may replace.27emby something else, like.5ex). – Symbol 1 Oct 07 '21 at 08:45axis_heightin thetikz-cdmanual. – Symbol 1 Oct 07 '21 at 08:48axis_height,baseline={([yshift=-axis_height]current bounding box.center)}(same for1-row diagram) works great. See also https://tex.stackexchange.com/questions/618054/fake-vcenter-in-tikz-using-baseline/618057#618057. – tobiasBora Oct 07 '21 at 09:46