I've confused myself about endomorphisms of a non-free module. Here's the situation:
Let $R$ be a non-commutative ring, let $M\subset R^2$ be a projective left $R$-module which has two generators over $R$, say $e_1,e_2\in R^2$. Then it seems that any $R$-linear endomorphism $\varphi:M\to M$ is determined by where we send these two generators, since all elements of $M$ are of the form $ae_1+be_2$, and we have that $\varphi(ae_1+be_2)=a\varphi(e_1)+b\varphi(e_2)$. Then any endomorphism is of the form $\varphi(e_1)=a_1e_1+a_3e_2$, and $\varphi(e_2)=a_2e_1+a_4e_2$, which we can write as a matrix if we want: $$\begin{bmatrix}a_1&a_2\\a_3&a_4\end{bmatrix}\in M_2(R).$$
But then it seems that $\text{End}_R(M)\cong M_2(R)\cong \text{End}_R(R^2)$? This seems strange to me, so perhaps I've made an error somewhere? As a semi-related question, is the determinant of such a matrix defined the same way for this non-commutative $R$, i.e. $a_1a_4-a_2a_3$?
Take your favorite ring $A$ and consider $R=A\times A\times A$. As projective module take $M=A\times A\times\{0\}$, with generators $e_1=(1,0,0)$ and $e_2=(0,1,0)$.
There is no endomorphism of $M$ sending $e_1$ to $e_2$, for instance. Indeed, if $\varphi(e_1)=e_2$, we have $\varphi(e_1)=\varphi(e_1e_1)=e_1\varphi(e_1)=e_1e_2=0$, a contradiction.
Actually, the endomorphism ring of $M$ is $A^\mathrm{op}\times A^\mathrm{op}$, which is very different from $M_2(R^\mathrm{op})$.
The problem in your reasoning is that you can't arbitrarily choose $a_1,a_2,a_3,a_4$. This is possible if $M$ is free with basis $\{e_1,e_2\}$.