I there! I own an M50 myself, however I should add that I've actually never used any kind of MIDI with it, but I have a guess that might be worth trying, at least.
When it comes to using the M50 as a controller for another soundmodule, it sends signals through the MIDI channels. If you go to Combi --> P3 "Timbre Param" you can see which channels that are sending MIDI signals, and which channels that are being used by the keyboard itself.
Now, here comes the guessing part: If you change the appropriate channel to "Gch" or "01G" (I don't know which one), you're telling the keyboard to use that channel on its own, instead of sending it somewhere else.
If this works, the M50 sounds will be played by the M50. However, I guess (once again, just guessing, I actually barely have any MIDI experience myself

) that the Kurzweil will still react the way it "should" when it's connected with MIDI. Which I guess in this case would be using the M50 sounds. So you will have to find a way to turn it off on the Kurzweil too.
Hope this helped out a little ^^