As Woofgang states, so-called 'lie detectors' are really stress detectors. Anyone who is asked to take a lie detector test under the circumstances you describe would almost certainly already have been accused of committing the crime. Therefore, if he genuinely can't remember what he was doing at the time of the alleged offence, he's likely to experience stress (through confusion, as he tries to recall what actually happened) when he's again asked about it under test conditions. That could occur whether or not he'd actually committed the offence, meaning that he'd appear to be lying in either case.