Mazda5 wants to start out in 4th

Hello all,

Longtime reader, first time posting.

2006 Mazda5
Recently replaced head gasket AND head.
The replacement of gasket and head seem to have gone ok. Had to replace the Mass Airflow Sensor. Don't know why it failed. After engine was put together it would turn over. Run for .5 second then die. I disconnected the MAS connection, started right up. But would run rough. After 2 failed NEW sensors it stayed running.

Ok. Enough about that.

When I went to back it out it had to get to 3k rpms to engage reverse. When i shifted to drive, the gear number in dash went to 1. Then real quickly to 3, then 4. Staying in 4.
The AT light came on. No codes though.

Needless to say, the car doesn't take off well in 4th. I shut it off. Restart it. Goes to 1 when i shift to drive. I hit the accelerator and it quickly shifts to 3 then 4. In seconds.

Fluid level was fine. Dirty though. So i changed filter and replaced with proper fluid and filter from O'Reilly's. Checked soleniods for continuity and such. All checked out good.

Started back up. Same issue.

Wth!! Ran it in reverse for 15 feet or so. Lurching and all. Put in drive. Again with the gear 4. Pushed accelerator anyway. Parked it back in repair space.

Anyone have this issue ever happen to their Mazda5 or any Mazda with a 2.3L and auto transmission?
2010 Mazda 5 Sport
I think that the cheap code readers only read the engine ECM which triggers the MIL light. The transmission computer may have codes an expensive reader can access.

Just talking out of my ass here...but doesn't the transmission shift based on vacuum lines from the engine? Maybe one is not hooked up correctly?

I looked for hoses or even wires which may be cracked/brittle. Nothing. Maybe the ecu/pcm got shorted somehow. All i did was disconnect battery. Was off for about a month. I don't get it.
2010 Mazda 5 Sport
Maybe the TCM did go bad. I'd probably take it to the dealer at this point to get a diagnosis.

Keep us posted though?
2010 Mazda 5 Sport
So, sorry for my there a transmission CPU (TCM) and and engine CPU (ECM) on these cars? Or just one PCM?
Apparently on the 05-07 the TCM is inside the PCM. No separate modules.

Guess I'll call dealer see what they say. Probably won't help.
2006 Mazda 6 - auto
Those prices seem pretty cheap, where are you located. In Southern CAL, the diagnose fee is like $100+. If they reprogram it, you should get all the latest firmware.
I'm north of Fresno. It's just a hassle having to get it towed and them taking their time to get to it. It's probably gonna be there a week. I just don't understand how the PCM failed from sitting while the head was being replaced.
WOW! This event only took place after head was repaired so put in original ECU and find the real issue such as vacuum line to transmission in wrong location or connector pins were bent during reinstallation etc. See this all the time! You will receive a huge bill from the dealer and be lucky if they can find an original issue such as this. Bring it back to the shop that repaired the head. Simple math says they messed up!