I didn't find the bug (code seems ok) but I wouldn't disable the gravity in runtime. Instead I would set isKinematic flag on/off, in this way (when isKinematic is on) you know that no forces are affecting your player. And for the slopes I would just apply a bigger force.