A police officer narrowly avoided being struck by an out-of-control car whilst he was assisting stranded passengers.