here is what you did wrong:

AX + B = C

AX = C - B <---you're fine up to here

A^{-1}(AX) = A^{-1}(C - B) <--you multiplied C - B on the wrong side.

X = A^{-1}(C - B).

if you multiply C - B on the LEFT by A^{-1}, you get:

with matrices, AB is NOT the same as BA.