Giving it a quick look it seems like the game is doing the following:
1. Creates a MF media session. 2. Creates a MF media source, 3. Creates a MF topology with the media source, 4. IMFMediaSession_BeginGetEvent (then handles the produced events asynchronously) 5. IMFMediaSession_ClearTopologies 6. IMFMediaSession_SetTopology 7. IMFMediaSession_Start
Then, when the user selects another character, it does:
8. IMFMediaSource_Shutdown 9. loops to 2.
The IMFMediaSession_Start call queues an internal media session START command, that subscribes to media source events and then calls IMFMediaSource_Start. It then asynchronously waits until the corresponding MESourceStarted event is received before completing its START command with a corresponding media session event. The media session command queue uses its own list of commands and doesn't queue additional async calls while a media source command is pending.
Now, the game IMFMediaSource_Shutdown call can sometimes be received after a IMFMediaSource_Start call has been made by the media session, but before the media source async command has been executed. When the command is executed, the media source has been shutdown already and it cannot queue any kind of event anymore for the media session to receive it.
The media session is then stuck in its PENDING command state, and cannot process any other asynchronous commands.
This looks to me like a media session bug, and it should instead be robust to this, especially as in this use case the ClearTopologies command should probably ignore any previous error or forever pending commands.