AudioPluginHost 5.4.3 : MIDI effect produces double notes?

I think I may have found it, although I don’t really understand it. When my plugin is being called, it seems its MIDI output is being added to its input.
juce_VST3PluginFormat.cpp:
template
void processAudio (AudioBuffer& buffer, MidiBuffer& midiMessages,
Vst::SymbolicSampleSizes sampleSize, bool isProcessBlockBypassedCall)
{
// midiMessages has 1 event here, the input for my plugin
// …data setup skipped…
associateTo (data, buffer);
associateTo (data, midiMessages);

    processor->process (data);

// midiMessages still has one event here
for (auto* q : outputParameterChanges->queues)
{
// …
}
MidiEventList::toMidiBuffer (midiMessages, *midiOutputs);
// now midiMessages has 2 events (input + output)
// …
}
If I look at toMidiBuffer:

case Steinberg::Vst::Event::kNoteOnEvent:
result.addEvent (MidiMessage::noteOn (createSafeChannel (e.noteOn.channel),
createSafeNote (e.noteOn.pitch),
(Steinberg::uint8) denormaliseToMidiValue (e.noteOn.velocity)),
e.sampleOffset);
break;