Example 5 Given that when $x \in[0,1]$, the inequality
$$
x^{2} \cos \theta-x(1-x)+(1-x)^{2} \sin \theta>0
$$

always holds. Try to find the range of $\theta$.

Let $f(x)=x^{2} \cos \theta-x(1-x)$
$$
\begin{array}{l}
+(1-x)^{2} \sin \theta \\
=(\cos \theta+\sin \theta+1) x^{2}-(1+2 \sin \theta) \cdot x \\
+\sin \theta .
\end{array}
$$

From the problem, we know $\left\{\begin{array}{l}f(0)=\sin \theta>0 \\ f(1)=\cos \theta>0\end{array}\right.$.
Under conditions (1) and (2), the axis of symmetry is
$$
x^{\prime}=\frac{1+2 \sin \theta}{2(\cos \theta+\sin \theta+1)} \in(0,1) \text {. }
$$

Therefore, to ensure that $f(x)>0$ for all $x \in[0,1]$, it is sufficient that
$$
\Delta=(1+2 \sin \theta)^{2}-4 \sin \theta(\cos \theta+\sin \theta+1)\frac{1}{2}$.
Combining (1), (3), we solve to get
$$
2 k \pi+\frac{\pi}{12}<\theta<2 k \pi+\frac{5 \pi}{12}(k \in \mathbf{Z}) .
$$