So, the switch Dr will control the two devices ~independently~.
It can send changes on any of 16 channels, all on the same cable. MIDI THRU is a feature that a device passes through all the messages to the next device in the chain.
So you chain your devices.
Tell one device to listen on channel X, the other to listen on channel Y… They should ignore anything not on their channel!