Q:

\insertlecture in subtitle generates error but \insertlecturenumber does not

In beamer, if I use \insertlecture in a subtitle I get:
Undefined control sequence \begin{document}

but the file compiles to PDF (with XeLaTeX) correctly anyway. 
But I can use \insertlecturenumber with no error.
MWE:
\documentclass[xcolor=dvipsnames]{beamer} 
\let\Tiny=\tiny
\setbeamercolor{structure}{fg=OliveGreen!50!black} 
\usetheme{Madrid} 

\title[Title]{Long Title}
\subtitle{Lecture \insertlecturenumber : \insertlecture}

\AtBeginLecture{
\setcounter{framenumber}{0}
\begin{frame}[plain]
\titlepage
\end{frame}
}

\begin{document}

\lecture[LectShort]{LectLong}{1}

\begin{frame}
  Text
\end{frame}
\end{document}

If I change:
\subtitle{Lecture \insertlecturenumber : \insertlecture}

To:
\subtitle{Lecture \insertlecturenumber}

It works with no error.

A:

I've read somewhere (probably not far away) that some beamer commands are not valid until \begin{document} has been applied. I don't know why and don't know which commands, but I've tested with OP's code and it worked:
\documentclass[xcolor=dvipsnames]{beamer} 
\let\Tiny=\tiny
\setbeamercolor{structure}{fg=OliveGreen!50!black} 
\usetheme{Madrid} 

\AtBeginLecture{
\setcounter{framenumber}{0}
\begin{frame}[plain]
\titlepage
\end{frame}
}

\begin{document}
\title[Title]{Long Title} %<------ Moved to document body
\subtitle{Lecture \insertlecturenumber : \insertlecture} %<--- Moved to document body

\lecture[LectShort]{LectLong}{1}

\begin{frame}
  Text
\end{frame}
\end{document}

