Sam Kerr tried to break the window of a taxi amid fears she was being kidnapped by its driver before she “racially abused” a police officer, a court has been told.