midi keyboard

I think what you are missing is that MIDI out does not pass MIDI messages to the next device.
That’s what MIDI thru is for. You need a MIDI thru box or patchbay to achieve what you want to do.