Given vectors $a_1, b_2, a_2, b_2 \in \mathcal{R}^{n\times 1}$, I am interested in finding a positive semi-definite matrix $M \in \mathcal{R}^{n\times n}$, $M \succeq 0$, such that $M\cdot a_1 = b_1$, $M\cdot a_2 = b_2$. Here $n \gg 2$, say $n = 1000 $. $a_1, a_2$ are not parallel and are non-zero.
To write it in equations, I want to solve the following semidefinite program
\begin{equation*} \begin{aligned} & \underset{M}{\text{minimize}} & & 0 \\ & \text{subject to} & & M\cdot a_1 = b_1 \\ && & M\cdot a_2 = b_2 \\ &&& M \succeq 0. \end{aligned} \end{equation*}
Depending on the value of $a_1, b_2, a_2, b_2$, sometimes a numerical solver will report this program is infeasible (no such $M$ exists). I have experimented with multiple solvers with identical result. I can further impose that $a_1^T\cdot b_1>0, a_2^T\cdot b_2>0$, but the result is the same.
An observation: If $a_1, a_2$ are orthogonal, it appears the problem is always feasible.
My intuition is that the number of free variables in $M$ is $(n(n+1)/2 -n)$, because a symmetric matrix has $n(n+1)/2$ free variables, and positive semidefiniteness requires all principal minors to be positive, adding $n$ constraints. It appears this intuition is not correct.
What is the requirement of $a_1, b_2, a_2, b_2$ for $M$ to exist?