DefDframe Issue

edited September 6 in RobotStudio
I am struggling to understand how to apply the DefDFrame function. I have set up a simple application in RobotStudio to test the function but am not getting the results I expected. What I have done is create two boxes with point p_10, p_20 and p_30 located on the original box and p_40, p_50, and p_60 located on the displaced box. When the box is only displaced in XYZ with no rotation the frame is correct when saving it into my work objects object frame. If I have any rotational displacement the calculated frame will have the correct rotation, but it's not placed in the correct XYZ spot. Am I misunderstanding how the DefDFrame works?

 Here is the code I am using:
TASK PERS wobjdata wobjBox:=[FALSE,TRUE,"",[[350,-50,30],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
    TASK PERS wobjdata wobjNewBox:=[FALSE,TRUE,"",[[350,-50,30],[1,0,0,0]],[[2.98023E-5,150,0.000156462],[0.991445,-0.130526,-4.0608E-8,-5.63615E-7]]];
    CONST robtarget p_10:=[[350,-50,30],[1,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget p_20:=[[450,-50,30],[1,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget p_30:=[[350,50,30],[1,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget p_40:=[[350,109.468,41.919],[1,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget p_50:=[[450,109.468,41.919],[1,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget p_60:=[[350,206.061,16.037],[1,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

    PROC main()
        VAR pose frame1;
        frame1:=DefDFrame(p_10, p_20, p_30, p_40, p_50, p_60);