Matrix multiplication - inconsistent behaviour

I have appreciated your help.