Sporadic glitch in align environment using quarto

When working with raw content you want to insert, this advice to use Raw block and mark it as raw LaTeX. Otherwise, it could be parsed by Pandoc and lead to some "glitch" as you are talking about.

Here, I believe you know this is valid LaTeX code so mark it as such

---
title: "AlignBugTest1"
format: 
  pdf:
    pdf-engine: pdflatex
    keep-tex: true
    include-in-header:
    - text: |
       \usepackage{amsmath}
       \newcommand{\bx}{\mathbf{x}}
       \newcommand{\by}{\mathbf{y}}
       \newcommand{\bS}{\mathbf{\Sigma}}
       \newcommand{\bmu}{\boldsymbol{\mu}} 
---

```{=latex}
\begin{align}
    & \Big( \big( \bmu^T \bS^{-1}\ |\ \alpha - \bmu^T \bS^{-1} \mathbf{1}_d
       \big) - \mathbf{1}_{d+1}^T \Big) \log{(\bx)} \notag \\
  = & \left( \left[ \bmu^T \bS^{-1}\ + 
                  \Big(\frac{\alpha}{d+1} - \frac{\alpha}{d+1}\Big)\ \mathbf{1}_d^T \Big|\
                  \Big(\frac{d\, \alpha}{d+1} + \frac{\alpha}{d+1} \Big) - 
                  \bmu^T \bS^{-1} \mathbf{1}_d
            \right] - \mathbf{1}_{d+1}^T \right)
            \log{(\bx)} \notag \\
  = &  \left( \bmu^T \bS^{-1}\ - \label{eq:AlphaTrans}
              \frac{\alpha}{d+1}\ \mathbf{1}_d^T \right) \by +
       \left( \frac{\alpha}{d+1} - 1 \right) \sum_{i=1}^{d+1} \log{(x_i)} 
\end{align}
```

By doing so, there should be no error