If first detent, then mechanism out of alignment or broken, or in need of a drop of lubricant. If second position, then again could need lubricating, but make sure the locking latch moves back and that the release lever is returning. You can easily check this by watching the mechanism whilst an assistant operates the lever inside the car.
(Bonnet latching is one of the most common problems I come across on Fiestas, it seems they are more prone to corrosion because of a relatively exposed position.)