Please Help! DSP ProcessorChain not works

Hi! I am developing a plugin which takes 3 inputs, one for a sidechain and one for the DAW stereo audio; my idea is, by means of a processorchain, to process the stereo buffer with respect to the sidechain. however, when testing and trying to send the audio to the processorchain, it seems that it has no effect or that the signal is simply not affected by it - am I doing something wrong?
I would appreciate your answers, thank you very much.

I attach the processBlock, prepareToPlay and where I create the proccessorchain.


    using FilterBand = juce::dsp::ProcessorDuplicator<juce::dsp::IIR::Filter<float>, juce::dsp::IIR::Coefficients<float>>;
    using Gain = juce::dsp::Gain<float>;
    juce::dsp::ProcessorChain < FilterBand, Gain > filter;

void SpaceitorAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock)
    // Use this method as the place to do any pre-playback
    // initialisation that you need..
    newSampleRate = sampleRate;
    juce::dsp::ProcessSpec spec;
    spec.sampleRate = newSampleRate;
    spec.maximumBlockSize = juce::uint32(samplesPerBlock);
    spec.numChannels = juce::uint32(getTotalNumOutputChannels());

    auto& masterGain = filter.get<1>();


    float Q = 0.707;
    juce::dsp::IIR::Coefficients<float>::Ptr newCoefficients;
    newCoefficients = juce::dsp::IIR::Coefficients<float>::makePeakFilter(newSampleRate, 1000, Q, juce::Decibels::decibelsToGain(-30));

    filter.get<0>().state = *newCoefficients;

void SpaceitorAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages)
    juce::ScopedNoDenormals noDenormals;
    auto totalNumInputChannels  = getTotalNumInputChannels();
    auto totalNumOutputChannels = getTotalNumOutputChannels();

    auto mainInputOutput = getBusBuffer(buffer, true, 0);  
    // [5]
    auto sideChainInput = getBusBuffer(buffer, true, 1);
    const float* inSide;

    juce::dsp::AudioBlock<float> ioBuffer(mainInputOutput);

    int totalNumInputChannelsmain = mainInputOutput.getNumChannels();

    auto totalNumInputAudioBlock = ioBuffer.getNumChannels();
    auto totalNumOutputChannelsAudioBlock = ioBuffer.getNumSamples();

    for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
        buffer.clear (i, 0, buffer.getNumSamples());
        for (int sample = 0; sample < buffer.getNumSamples(); ++sample)
           const float*inR = mainInputOutput.getReadPointer(1);
           const float* inL = mainInputOutput.getReadPointer(0);

           float* OutL = mainInputOutput.getWritePointer(0);
           float* OutR = mainInputOutput.getWritePointer(1);

           OutL[sample] = inL[sample];
           OutR[sample] = inR[sample];


        juce::dsp::ProcessContextReplacing<float> context(ioBuffer);