"In the original code (and in your original post at the top) wp_lat[0] and wp_lon[0] were commented out and so are not set to zero. They would be set in the Navigation function Save_Launch_Parameters as the actual GPS position of the launch point.…"
First, I have been known to be wrong. Frequently. But I think you have a bit of a problem with your waypoints. The waypoints, as set in the code, are relative to the starting point of the airplane as determined by the GPS. So I think you may…"