Mavros Stuck on Loiter Waypoint

Hello everyone, i am working on an autonomous mission code using Mavros. I finished my work but there is a bug. My mission is like:
Take off, waypoint, loiter waypoint, waypoint, waypoint, land.

When my fixed wing uav reaches to loiter waypoint, it needs to take 2 tours around loiter waypoint, but it doesn’t. Sometimes it takes 2 tours and finishes the mission succesfully but it is rare. Mostly it stuck on loiter waypoint. I do not know why. I never change the script. Same script works sometimes but does not works mostly.
I use NAV_LOITER_TIME = 19 command on my script for loiter waypoint.

By the way, i tried to use NAV_LOITER_TURNS = 18 command, it is much more useful for me, because i need to count turns not time. But i couldn’t use this command on my script, it kept giving me error like “IGN MISSION ITEM, BUSY”

If anyone knows why i get those errors, please reply.
Thank you all!