Let $e_1,\ldots,e_n$ be the standard basis in $\mathbb{R}^n$. Suppose the scalars $\lambda_1,\ldots,\lambda_n$ satisfy $0< \lambda_1,\ldots,\lambda_n\leq1$ and $\lambda_1^2+\ldots+\lambda_n^2 = m$, where $m$ is a positive integer less than or equal to $n$. Does there always exist a $m$-dimensional subspace $W$ of $\mathbb{R}^n$, such that the length of the orthogonal projection of $e_i$ onto $W$ equals $\lambda_i$ for each $i=1,\ldots,n$?
I tried to reformulate the question by considering an orthonormal basis $v_1,\ldots,v_m$ of $W$, then the orthogonal projection of $e_i$ onto $W$ is $\sum_{j=1}^{m}\langle e_i,v_j \rangle\cdot v_j$, and the length of the projection will be $$\sqrt{\sum\limits_{j=1}^{m}\langle e_i,v_j \rangle^2} = \sqrt{\sum\limits_{j=1}^{m}A_{ij}^2}$$ where $A$ denotes the $n\times m$ matrix with column vectors $v_1,\ldots,v_m$.
I also solved the case $m=1$, where one can just take $v_1 = (\lambda_1,\ldots,\lambda_n)$, and from this I can also solve the case $m=n-1$, where one can take $W$ to be the orthogonal complement of $\text{span}\{(\sqrt{1-\lambda_1^2},\ldots,\sqrt{1-\lambda_n^2})\}$.
This question originated from the observation that if $l_1,\ldots,l_n$ are the lengths of orthogonal projections of $e_1,\ldots,e_n$ onto a $m$-dimensional subspace, respectively, then the equality $l_1^2+\cdots+l_n^2 = m$ would always hold, so I wondered if the converse would also be true.