When this happened to me I pushed the door hard to close it and then it worked, I had to do it a couple of times though, the latch seems to go into a state of limbo if it doesnt release fully. I have had it happen on one of my rear doors too, same procedure worked.
Just a thought