Example 6 Given the inequality
$$\sqrt{2}(2 a+3) \cos \left(\theta-\frac{\pi}{4}\right)+\frac{6}{\sin \theta+\cos \theta}-2 \sin 2 \theta<3 a+6$$

for $\theta \in\left[0, \frac{\pi}{2}\right]$ to always hold, find the range of values for $a$.
Let $\sin \theta + \cos \theta = x$, then $x \in [1, \sqrt{2}]$, and
$$\begin{aligned}
\sin 2 \theta & = 2 \sin \theta \cos \theta = x^2 - 1 \\
\cos \left(\theta - \frac{\pi}{4}\right) & = \frac{\sqrt{2}}{2} \cos \theta + \frac{\sqrt{2}}{2} \sin \theta = \frac{\sqrt{2}}{2} x
\end{aligned}$$

Thus, the original inequality can be transformed into
$$(2a + 3)x + \frac{6}{x} - 2(x^2 - 1) > 0 \\
(2x - 3)(x^2 - ax + 2) > 0
\end{array}$$

Since $x \in [1, \sqrt{2}]$, we have $2x - 3 < 0$. Therefore, $x + \frac{2}{x} > 0$ for $x \in [1, \sqrt{2}]$.

Let $f(x) = x + \frac{2}{x}$, $x \in [1, \sqrt{2}]$, then $a > f_{\text{max}}(x)$.
Since $f(x) = x + \frac{2}{x}$ is monotonically decreasing on $[1, \sqrt{2}]$, we have $f_{\text{max}}(x) = f(1) = 3$, so the range of $a$ is $a > 3$.