Coordinate system difference between RAPID and Virtual FlexPendant

I recently built a virtual robot station with an external axis in the Z direction in RobotStudio. The additional axis will just lift the robot up, but I encounter an error where there will be the error of "Position outside reach" only on the moves involving the motion of the external axis. The coordinate in RAPID program correctly contains the value of external axis.

After a thorough check of the program and online resources, I found that the error happened as a result of the difference between the coordinates in the RAPID program and the Virtual FlexPendant. However, I am desperately in need of advice on how to correct them as I don't have much experience on this matter. In my situation, the movement of target in X axis is the correct way to activate the movement of the lift in Z axis somehow.

Please see the video for the simulation I made where the robot movement is completely different from the path I created. The point on top of the triangle created in RobotStudio cannot be reached, while the point created by the virtual FlexPendant resulting in a horizontal triangle works as intended.