In this instance it is nearly certain you are going to have a sticking switch on the rear latch panel. The rear latch panel is the vertical panel mounted directly against the back seat area that the two tonneau strikers attach to.
Under normal operation, the top simply moves straight through a series of motions checking to see if each switch along the way is in the correct position to proceed to the next step. With it stopping with the tonneau down and 5th bow up, yet retracting all the way normally, this really only leaves the latch panel as your suspect.
To verify 100% you would need a topstack compatible scan tool to read the switch inputs as it moves, however there is a quick check you can do that has often useful results.
Open the tonneau (you can either just open the tonneau or retract the top fully but stop with the tonneau up) and then turn the key off so the top ecu doesn't time out.
Looking at the back seat you will see the two latches where the tonneau locks in. Looking carefully at them you will see a black plastic lever in front of each... this is the switch lever that tells the ecu the tonneau is down all the way and allowed to drop the 5th bow.
Spray some WD40 in both latches to saturate the switch area, then use your finger to work the plastic lever on/off multiple times vigorously. This will often free a sticking switch.
Once satisfied, check operation again and see if it is resolved.
Note that this is not a permanent fix.... if the latch panel switch stuck like it definitely sounds like, the latch panel will require replacement (or if you have an electronics supply near you then you may be able to match up the cherry switch with a replacement.... from Mitsubishi you can only get the whole panel though).