Is it probably the ECU?

^^ Yep, flipping the polarity is easy; just reverse the 2 wires at any connection between the distributor and the ECU. If any of your connections distributor-to-ECU connections can be flipped either way, then it would be easy to do by mistake.

Could be weaker spark or messed up timing for the low RPM problem you describe; but could be other things too. It is just the change of boxes that you report as coincidental with this problem that points to the ignition.

Sounds like you would be helped to invest in a timing light and use it....