Suppose that $\mathbf{A}$ and $\mathbf{B}$ are two $N\times M$ matrices with $N\leq M$ and $\text{rank}(\mathbf{A}) = \text{rank}(\mathbf{B}) = N$.
Question : Is the following statement true ? If yes, why ? If no, under what condition is it false ?
If $\text{rank}[(\cos\alpha\mathbf{I})\mathbf{A}+(\sin\alpha\mathbf{I})\mathbf{B}] = N$ for any given $\alpha$, then $\text{rank}(\mathbf{C}\mathbf{A}+\mathbf{S}\mathbf{B}) = N$.
$\mathbf{I}$ is the $N\times N$ identity matrix. $\mathbf{C}$ and $\mathbf{S}$ are two $N\times N$ diagonal matrices with $\mathbf{C} = \text{diag}(\cos\theta_1,\cdots,\cos\theta_N)$ and $\mathbf{S} = \text{diag}(\sin\theta_1,\cdots,\sin\theta_N)$, each $\theta_i$ takes an arbitrary value.
Example : A special case where the statement is true
$\mathbf{A} = \begin{bmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0\end{bmatrix}$, $\mathbf{B} = \begin{bmatrix}0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0\end{bmatrix}$
$\text{rank}(\mathbf{A}) = \text{rank}(\mathbf{B}) = 2$
$(\cos\alpha\mathbf{I})\mathbf{A}+(\sin\alpha\mathbf{I})\mathbf{B} = \begin{bmatrix}\cos\alpha & 0 & 0 & \sin\alpha \\ 0 & \cos\alpha & \sin\alpha & 0\end{bmatrix}$
since $\cos\alpha$ and $\sin\alpha$ cannot both be $0$, $\text{rank}[(\cos\alpha\mathbf{I})\mathbf{A}+(\sin\alpha\mathbf{I})\mathbf{B}] = 2$ for any given $\alpha$.
$\mathbf{C} = \begin{bmatrix}\cos\theta_1 & 0 \\ 0 & \cos\theta_2\end{bmatrix}$, $\mathbf{S} = \begin{bmatrix}\sin\theta_1 & 0 \\ 0 & \sin\theta_2\end{bmatrix}$
$\mathbf{C}\mathbf{A}+\mathbf{S}\mathbf{B} = \begin{bmatrix}\cos\theta_1 & 0 & 0 & \sin\theta_1 \\ 0 & \cos\theta_2 & \sin\theta_2 & 0\end{bmatrix}$
$\text{rank}(\mathbf{C}\mathbf{A}+\mathbf{S}\mathbf{B}) = 2$ for any pair of $(\theta_1,\theta_2)$.