As always, I'll start by saying that computing the inverse of a matrix is a bad idea. And of course, you don't say what you think is "wrong", nor do you provide the matrix. (Just attach it to a comment in the form of a .mat file. Since it is sparse as you claim, it won't take much space anyway to store.)
First, you need to understand if the matrix is of full rank. If not, then you cannot find the "right" result, as there are infinitely many solutions, if you would find any solutions at all.
You also need to learn about things like condition numbers. But without seeing the matrix itself, this answer would then turn into a full course on numerical linear algebra. And, while you would surely benefit from that since you are trying to compute the inverse of a matrix, Answers is not the place to teach it. So post the matrix in a .mat file, attached to a comment, and we can see if we can help you more.