Crash after a loiter

Hi guys,

after around 50 flights, I had a several crash with an airplane. After the takeoff, there was a loiter from 30 mts to 150 mts, and insteado to gain altitude the airplane dive and hit the ground.
I was analyzing the logs and the pitch controller was ordering to dive and the desired pitch was to gain altitude.
Can someone point me what can cause this behavior ? I was looking all the main points - hdop, gps number os sats, battery and I can’t find what cause this behavior.

Thanks a lot.