The US president has regularly attacked Comey’s handling of the investigation into contacts between Russians and his 2016 campaign.