This symptom is usually the result of actions expected to take place during the transition of a transfer case mode change which has not happened. When the transfer case changes from 2WD to 4WD (for example), the front axle is Locked by the transfer case shift control module. If the transfer case shift control module does not sense that the front axle is applied, it waits for the action to take place before the gear change is made. While waiting, the mode switch lamp will continue to flash for a period of time, at which time all other mode requests will be ignored for the duration of the ignition cycle.
To start the diagnosis of this problem I suggest you have the TCCM (transfer case control module) & PCM (powertrain control module) scanned for failure codes which could very well lead you to the root cause.I find a good bit of the time the problem is the TCCM.