A confessed killer responsible for a “horrific” random machete attack on a 14-year-old boy has made an unexpected claim in court.