Problems with postMessageToSystemQueue in Unity

I’m having trouble related to this function running in Unity:

bool MessageManager::postMessageToSystemQueue (MessageManager::MessageBase* const message)
{
    message->incReferenceCount();

  #if JUCE_MODULE_AVAILABLE_juce_audio_plugin_client && JucePlugin_Build_Unity
    if (juce_isRunningInUnity())
        return SendNotifyMessage (juce_messageWindowHandle, WindowsMessageHelpers::customMessageID, 0, (LPARAM) message) != 0;
   #endif

    return PostMessage (juce_messageWindowHandle, WindowsMessageHelpers::customMessageID, 0, (LPARAM) message) != 0;
}

The problem is that all sorts of messages which are assumed to be handled later on the UI thread (e.g. after any components are deleted etc.) are instead handled immediately inside SendNotifyMessage. One example that was causing problems was a popup menu being deleted, which caused a fake mouse move message to be posted, which tried to create a weak pointer to a component that was in the middle of being deleted – but there were other examples.

I’ve worked around this by skipping the system message queue completely, instead storing these messages in an array and calling a function periodically from C# to deliver them. But I’m curious if others have hit this problem or if I’m misunderstanding what’s going on somehow.

Thanks,
Ethan