This might / might not apply to your car . Some cars have a micro switch in lock assembly that tend to stick and can be freed of with WD 40
How To Replace Door Jam Switch On A 2005-2009 Ford Mustang
How To Replace Door Jam Switch On A 2005-2009 Ford Mustang