I can tell you what I know about the mechanics, and we can see if it leads to something that help makes sense. Honestly though it is probably going to be a bug fix no matter what, but you can probably narrow it down to where the problem is.
The supervisor information (i.e. Agent Manager) comes from a process called EMIS that handles all real time data and writes out historical data. When things change, the routing layer (LRL) tells EMIS what the changes are and it updates accordingly.
For example, an agent ends a call and goes into wrap:
1. LRL gets a notification via TAPI of the conclusion of the call.
2. LRL decides that now the agent gets a wrap-up, and puts them into a wrap state.
3. LRL tells EMIS that the agent is in a wrap state
So what you are experiencing can be defines as a disconnect between 1 and 2, or 2 and 3. If EMIS is reporting the agent in wrap, but the agent will be routed calls as if they are idle something is getting lost between LRL and EMIS. If both EMIS and LRL report the agent in a state that is not valid, then it is likely ECC lost a TAPI event that would trigger an update.
How can you tell? If you have access to the Restricted Technical Diagnostics on the ECC Console, one can peek directly at LRL via the Agents option. So when it happens, you can see which thing is reporting incorrectly. LRL is the key thing to monitor; it controls what ECC does rather than what it reports.
That was probably more than anyone ever wanted to know, but hey
