Why don't the nicematrix and fontspec package play well together?
Here is a MWE:
\documentclass{article}
\usepackage{nicematrix}
\usepackage{fontspec}
\usepackage{lipsum}
\begin{document}
\lipsum*[1-3]
$\begin{pNiceMatrix}a&b\\0&0\end{pNiceMatrix}$
\end{document}
When you comment out either the fontspec package or the nicematrix package (and the corresponding environment) the compilation runs fine. As is, if you put in a NiceMatrix environment, it still compiles, but throws the error LaTeX Error: Missing \begin{document}.