The order of the points determines the orientation on the curve. If the start point is on the left and the end point is on the right, then the curve is oriented so that "up" points above the curve. However, if you change the start / end points, the curve is oppositely oriented, so now the "up" actually points below the curve.
When your code detects a collision and then adjusts the speed, it uses the curve orientation. That is why when the ball falls on the curve, when the start / end points change places, it seems that they are jumping over the curve.
To fix this, the collision resolution code must check on which side of the curve the ball is (relative to the orientation of the curve) and adjust accordingly.
source share