If you can post a picture of the current shaft position I can tell you what range it is in.
Is your old motor is still installed? If yes then it IS possible that the TCCM could try to set the transfer case range to match the selector switch setting at power-up such as when you reconnected the battery.
Technically, the TCCM controls the position of the shift motor. The TCCM uses the signal from the sensor to determine where the motor is and then rotates the motor in the direction needed to match the selector switch.
Worth mentioning that the TCCM rotates the shift motor at different speeds as well so it can make large movements quickly and small adjustments as needed.
Here is the sound of a front axle disconnect actuator.
drive.google.com
And this is the sound of a shift motor. You can hear mine struggling a little here.
drive.google.com
And no-one asked but it interesting to know that the range position sensor and the switch signal go live even before you put the key in the ignition. I have a video showing the voltage at the sensor go live by just opening the door. If no further actions are taken like turning the key on etc. that sensor power from the TCCM turns off after 20 seconds.