Representation similar to $Z'X(X'X)^{-1}X'Z$ frequently appear to e.g. 2SLS.
I think that $Z'X(X'X)^{-1}X'Z = Z'XX^{-1}X'^{-1}X'Z = Z'(XX^{-1})(X'^{-1}X')Z = Z'Z$. So why it seems that in the context of e.g. 2SLS, the representation can not be simplified? What is the mistake I made?