You might want to do
\NewDocumentCommand{\Vector}{mmo}{%
\begin{bmatrix} #1 \\ #2 \IfValueT{#3}{\\ #3} \end{bmatrix}%
}
but I'm not sure you really want
\Vector{1}{2} \Vector{1}{2}[3]
which is difficult to see in the typescript.
\documentclass{article}
\usepackage{amsmath}
\NewDocumentCommand{\Vector}{mmo}{%
\begin{bmatrix} #1 \ #2 \IfValueT{#3}{\ #3} \end{bmatrix}%
}
\begin{document}
[
\Vector{1}{2} \quad \Vector{1}{2}[3]
]
\end{document}

I find that its much simpler to manage lists:
\documentclass{article}
\usepackage{amsmath}
\ExplSyntaxOn
\NewDocumentCommand{\Vector}{m}
{
\begin{bmatrix}
\clist_use:nn { #1 } { \ }
\end{bmatrix}
}
\ExplSyntaxOff
\begin{document}
[
\Vector{1,2} \quad \Vector{1,2,3} \quad \Vector{1,2,3,4}
]
\end{document}

If you don't like commas as separators and prefer, say, a semicolon, you can do as follows.
\documentclass{article}
\usepackage{amsmath}
\ExplSyntaxOn
\NewDocumentCommand{\Vector}{m}
{
\begin{bmatrix}
\seq_set_split:Nnn \l_tmpa_seq { ; } { #1 }
\seq_use:Nn \l_tmpa_seq { \ }
\end{bmatrix}
}
\ExplSyntaxOff
\begin{document}
[
\Vector{1;2} \quad \Vector{1;2;3} \quad \Vector{1;2;3;4}
]
\end{document}
Note I removed \ensuremath that does nothing really useful in this case and in several others.
Part of my campaign DUUE (Don't Use Unnecessary Ensuremath).
\Vector{1}{2}and\Vectorr{1}{2}{3}. – Sandy G Nov 06 '22 at 03:31