Police officers gave the man a telling-off for leaving the child behind.