Copter incomplete mission and crash

Hi there
Does anybody have any idea why my copter didn’t complete its mission in AUTO mode before switching to GUIDED? I have written a code in drone kit where it switches the copter to AUTO in the first place and after the mission is done the copter is switched back to GUIDED to return to the landing pad.
According to the logs the copter took off from the landing pad and then it was switched to AUTO but surprisingly the rest of the mission was left over. The copter got back near to the landing pad insanely. I managed to retake control but the the copter eventually crashed.


Log: https://drive.google.com/file/d/1M4mH31pWzP72pEUPwXCEM_ooxnJVgKI7/view?usp=sharing