This is intentional, there are bugs if you try to push slimes against the level boundary but because of puzzlescript limitations it's awkward to detect if that's happening. So instead I prevent you ever getting a slime next to the level boundary.
Hopefully it's not too confusing! It's not really the cleanest solution but I hoped it wouldn't be very obvious.