OK, I figured it out, the problem was due to Adafruit's library strange decision to overwrite the channel field of the message in the send method by its own parameter.
So,
midi.send(SomeMessage(..., channel=X))
should always be used as
midi.send(SomeMessage(...), channel=X)
instead. Then everything works as intended.