Unable to switch to POS_HOLD mode with error "Err: FLIGHT_MODE-16"

I have had this problem 2 times and it has always been a mystery for me. I have attached a log of the flight. As you can see when I try to change the flight mode to POS_HOLD, it still remains in STABLE mode and the error is reported in the log. Looking at the code I can see that the mode switch will not happen if the call to position_ok() fails. However as you can see in the log, there are enough satellites available. The EKF log shows PE, PN and PD is ok indicating that the position is known by the system. I was hoping someone can decipher this and then we can figure out how to avoid this. I have attached the log.
This particular log is for heli but I think that it does not matter because the issue is because of EKF which is code shared by all Copter code. I searched this forum to see if someone else had this issue. I did find a post, but in that case there was no GPS lock, so it is a totally different matter.
2016-08-19_18-32-05_mode_error_no_pos.zip (575.2 KB)