I think you have wrong setup of the workpiece coordinate system - your X direction is heading to the top (world Z) - that's why your tool is rotated in this direction
Rotate your workpiece CS to head with X down as this is your tool vector X
Also - did you setup your robot model correctly - all the angles, vectors and axis limitations?