I was flying a new quadcopter on Friday to test the Auto flight mode. I had a successful first mission and I tried to replicate it. Since my last waypoint was facing the opposite direction from takeoff and the RTL kept this heading, I manually rotated the copter to face the initial takeoff heading. In that moment I saw that the EKF text in my flight HUD became red, and when I clicked it I saw that the velocity bar was completely filled with red (the image below is just for reference since I don't know how to replicate it).
After that, I waited a couple of minutes since I knew I couldn't fly with that error. The red bar disappeared and it all seemed normal, so I changed to Alt. Hold in order to arm, and then to Auto to repeat the mission from the beginning.
A couple of seconds after taking off I saw again the velocity bar completely filled with red, and when the copter reached my target altitude (20 m), it started going sideways (in a completely random direction), instead of going forward to the first waypoint. I had no other option but to change it to Alt. Hold, take back control and land the copter manually. Luckily, nothing worse happened.
Finally, I restarted the Pixhawk by unplugging and plugging the batteries and it all went back to normal. I did 2 more Auto missions without any issues and that was it.
Moreover, I found this post reply which shows something similar to what happened to me, but in his case, it was combined with compass errors, which I don't have. What he mentions regarding velocity errors is that he has a peak in the speed measured by his GPS. It appears that I also have that peak during takeoff.
I'm worried since this was completely random and it could have been really bad hadn't I changed the flight mode to manual. Is there a way to prevent this issue? Is there an explanation to this? I hope you can help me shed some light on this issue (the flight log is attached). Thanks a lot in advance.