\documentclass{article}
\usepackage{unicode-math}
\setmathfont[version=xcharter]{XCharter Math}
\setmathfont[version=fira]{Fira Math}
\newfontfamily\xcharterfont{XCharter}
\newfontfamily\firafont{Fira Sans}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
\xcharterfont \mathversion{xcharter}
Some text. \(123 \alpha a \text{a}\)
\begin{theorem}
This is a theorem. \(\alpha = 1, 2\).
\end{theorem}
\firafont \mathversion{fira}
Some text. \(123 \alpha a \text{a}\)
\begin{theorem}
This is a theorem. \(\alpha = 1, 2\).
\end{theorem}
\end{document}
This generates the following output when compiled with XeLaTeX (no warnings or errors).
I want XCharter fonts to be used for Theorem 1 and Fira Sans for Theorem 2. How do I get them? Why are LM fonts used in both the cases (for text) instead of XCharter and Fira?