Attifacts from Sidechain Channel using AudioBlock in Pro Tools/AAX

Hi all, I’m running up against a problem that I haven’t been able to crack. Hopefully the forum might be able to help shed some light on my issue.

The Problem:
I’m converting an AudioBuffer of X channels into a dsp::AudioBlock object. I’m then extracting the channels for processing. The plug-in has a sidechain. If I remove my own processing/dsp, there are audible artifacts when monitoring what I presume to be the sidechain audio channel. Interestingly, this problem only rears it’s head in Pro Tools or AAX - in Logic, Reaper, etc… no artifacts.

After doing some deep debugging my best guess is that the channel ordering is behaving strangely although this might be incorrect. Here is a stripped down example of how to recreate the issue in AAX.

    ///presume mono input and mono sidechain
    auto* i = audioBlock.getChannelPointer(0);
    auto* s = audioBlock.getChannelPointer(1);
    /// loop over samples
    for (size_t n = 0; n < audioBlock.getNumSamples(); ++n)
        float sidechain = s[n];
        ///output sidechain to main audio
        i[n] = sidechain;

For some strange reason, this sounds intermittently okay and intermittently like the main input and sidechain are almost combined. Any ideas, thoughts or pointing out a flaw in my thinking is much appreciated. Cheers!