Ive had this problem and it drove me nuts when i came across it.
For me the problem was the lever in the drivers cabin. I had to wiggle it a little bit before the bonnet would catch. Altought saying that my wife helped me find the issue the first time it happened.
Sometimes the bonnet will close by itself other times it doesnt like it until i fiddle with the lever
Hope it helps