Could someone explain this to me?

If horizontal, the base line is a line, but if I put it on a stair, the baseline doesn't follow a line anymore and start to jump up or down, and it doesn't even behave equal in every stair. What am I doing wrong? How can I solve it?