A senior NSW Police officer was allegedly bashed while trying to interview a man after a bullet-riddled car was discovered near a major hospital.