Found a strange bug on HP Prime. When I make the simple calculation inv(TRN(M1))*TRN(M0) where M0 and M1 are square matrices I get the right answer. But when this calculation is plugged into a function, it returns a wrong answer.
Would you mind sharing your function here? We could see it better.
One of my suspicions is that your function id trying to attribute the result of your matrixes operations to a variable that doesn't match thw required tipe. I mean you may be tying to attribute a matrix to a real type variable, for example.