Mcp23017 getting very hot within seconds

Yes.
You could prove that out by plugging one into a breadboard simply enough.