FL studio is a special DAW, if you write 2 notes at the "same" time, higher note first in FL, in other DAWs, lower note first. You wrote a keyswitch and a melody note at the same time, melody note is higher, FL plays it then plays the keyswitch, so the keyswitch did not work.