MATLAB's linsolve() function uses QR factorization with column pivoting to find a least squares solution to your over determined problem.
You can use
[x,r]=linsolve(A,b)
to get an estimate of the rank of $A$. I believe that if $A$ is rank deficient, then MATLAB will set all of the free variables to $0$ in computing the least squares solution. If this is happening, it could explain why MATLAB's least squares solution is sparse.
If your matrix is of full column rank, then the least squares solution should be unique and your Python code should be finding essentially the same solution.
If your matrix not of full column rank, then there will be infinitely many least squares solutions, and it would be no surprise that your python code found a very different solution. As long as $\| Ax-b \|_{2}$ is the same for the solution obtained by your code and by MATLAB, you've got no real reason to complain.
The most complicated situation occurs when your matrix is badly conditioned so that it is on the very edge of not having full column rank. If you're in this situation then there may be many solutions that have very nearly equal values of $\| Ax -b \|_{2}$ and very different values of $x$.
I would suggest three things to look at:
Compare the values of $\| Ax-b \|_{2}$ for MATLAB's solution and the solutions produced by your Python code. They should be essentially equal.
Use [x,r]=linsolve(A,b) in MATLAB to get a least squares solution together with an estimate of the rank of $A$. This will give you some indication of whether $A$ is rank deficient.
Take a reasonably small test problem and compute the condition number of your $A$ matrix (in MATLAB, cond(A) will do this.) This should tell you whether you have a matrix that is effectively of full column rank or not.
The answers to these questions might help us in directing you further.