RTL not being executed in mission planner commands

I am using 3.1.1 with APM2.6. the quad flies excellent in all modes and is very stable. when I give RTL command the quad climbs to RTL height but does not returns to home. it keeps loitering at that height. the same happens in ‘takeoff’ command. any command following ‘takeoff’ is not executed in mission planning. all other navigation commands work perfectly. i am using 3DR frame with default parmas.

hi, am attaching the log files when flown with AC3.1.2

@russ, i think there is a bug in AC3.1.2 when you change the value of parameter ‘WP_YAW_BEHAVIOR’ from default of 2 to 1 the RTL command does not executes. the craft would rises to the RTL altitude and would keep loitering there. similarly after executing ‘takeoff’ command it does not executes the following command and instead keeps loitering at the takeoff altitude. when i changed this value back to 2 all the problems regarding these commands were solved. but this bug does not effects the ‘waypoint’ command. took me one month to find this problem. i changed to different APM2.5 many times. i did not try other values which are 0 and 3. but finally the bug has been found.