It could be 'bit-rot'. If the MCU's code is corrupted, and the two axes are each on the same bit positions of different ports, it would only take one bit flipped in the port initialization code, swapping one bit position from input to output to get the observed results.
Yes, there are actually so many scenarios how a port could fail, even including software corruption, I did not think about that. Not
very likely, but it could explain, how two separate inputs failed at once.