I did a quick google search for mazdaspeed and P2138: https://www.mazda3forums.com/threads/my-speed-wont-drive.275472/I’ve tried to be conscious of what pin is what. 2A should be the bottom left while laying on my back... So I’m 99% certain I got it right. But I’ll check again tomorrow.
All I can say about the throttle body wiring right now is that I checked continuity of all the pins on the connector to the corresponding pins on the PCM and everything was fine.
I’ll examine the wiring harness as you suggested.