Hello, my name is***** is the model of the pedal you are using?
We're dealing with either polarity, or mechanics of the pedal. If the wires are backwards, it could cause it to react oppositely. If the pedal is not for sustain, it could have a different mechanical build.
Is there a model number on it?
Yes, please stand by a minute.
Ok, that's definitely a sustain, but how it's built is not quite clear... When you step on the pedal, it closes the contacts, activating the sustain in the piano. You can try cutting the jack and reversing the two wires. This will work depending on how the insides are wired up.
Korg is built a bit different than Yamaha, and they are always throwing surprises. I would recommend using a Korg pedal with a Korg keyboard. Yamaha and Roland are interchangeable, but Korg is unpredictable.