Federer wins arguably the strangest match of his career