Just out of curiosity, are the displays identical?
Does the same thing happen if you physically switch the displays?
After doing the above and comparing the results with the normal connection, when you get "the switch", does the same display end up as the "main"? If so, there may become timing issue when waking the computer in terms of recognizing the the displays.
By default, if what is set as the main display does not immediately get recognized, it will jump to the next port and find if it recognizes that display and sets it as the main.
A fairly easy test to see if it is display dependent or not.
Also, not all I/O ports are recognized and initialized all at the same time, there is some order to the process. Perhaps waking from sleep is not the same order as reboot/power up.
Either way I would file a feedback to Apple as while you have found a workaround, it is not really the what should have been done to make it work:
Product Feedback - Apple