Call Out Box staying open when plugin closes on Mac

Hello, I am adding new UI to my audio plugin and a part of it involves clicking a text button that creates a call out box. On Windows, the call out box closes whenever the plugin is closed or another channel is clicked on. However, on Mac the call out box stays visible when the plugin is closed and when I click onto another channel. This is causing the DAW to sometimes crash. Does anyone know what I can do to make it so the call out box closes?

stemTypeButton.onClick = this
{
// Get the current selected stem type from the button text
juce::String currentSelectedStemType = stemTypeButton.getButtonText();

    // Create the StemTypeSelectionComponent with the current selected stem type
    // Using std::make_unique to create a unique_ptr
    auto stemTypeSelectionComponent = std::make_unique<StemTypeSelectionComponent>(currentSelectedStemType);

    // Set the callback to update the button text and dismiss the CallOutBox
    stemTypeSelectionComponent->onSelectionChanged = [this](const juce::String& selectedStemType)
        {
            stemTypeButton.setButtonText(selectedStemType);
        };

    // Define the area the CallOutBox should point to
    juce::Rectangle<int> areaToPointTo = stemTypeButton.getScreenBounds();

    // Configure the content component's LookAndFeel and colors before launching
    stemTypeSelectionComponent->setLookAndFeel(&customLookAndFeel);

    // Launch the CallOutBox asynchronously
    juce::CallOutBox& callOutBox = juce::CallOutBox::launchAsynchronously(std::move(stemTypeSelectionComponent), areaToPointTo, nullptr);
    callOutBox.setLookAndFeel(&customLookAndFeel);
    // Set properties on the CallOutBox
    callOutBox.setArrowSize(0.0f);
};
  1. Avoid CallOutBox if possible.
  2. If you do want to use it, give it a parent component instead of nullptr (nulltpr means desktop in this case)
        auto &box = juce::CallOutBox::launchAsynchronously(std::move(colourSelector),
                                                           parentC.getLocalArea(this, getLocalBounds()),
                                                           &parentC);
        box.setLookAndFeel(&laf);
        box.setArrowSize(0);
        box.sendLookAndFeelChange();

Full example is here, which is a colour selector: