Optimize will optimize total wait time across all rides, not get you the shortest wait for any specific ride.
So when it moves SMDT later, it might have a longer wait time for that ride, but it is because it gives you shorter wait times for other rides that save more time. If you move SDMT early, you MAY end up with a shorter wait for it specifically, but the waits for the other rides will go up.
Also, do keep in mind that you only get a short wait at RD for a ride if you are ahead of everyone else who is also RDing. On average, half of the people who RD will end up waiting a long time still because of the other half who were also RDing ahead of the.