Our kitten has always been good with the litter tray, but had one accident in the lounge (he got shut in by accident) and now keeps pooing there in the same spot, he is still using the litter tray too.
I have cleaned and cleaned the spot very throughly but it's not deterring him.
I'm sorry for the delay in responding, Lj. Proprietary cleaners don't always get rid of the smell and indeed some contain substances which remind the cats' sensitive noses of a tray.
You might want to read this old thread where someone had the same problem as you - and in particular, the posts by issey who fosters cats including ferals and semi-ferals who sometimes have rather 'approximate' toilet training.
I'd be inclined to clean the carpet again with non-bio detergent, put down a second tray there as soon as it's dry and try to keep an eye on him (after he's eaten in particular) and then pop him in his tray and maybe scratch his front paws in the litter a little to give him a reminder. I also like issey's notion of putting the poo in the tray for a bit if he has an accident - which would increase association and smell.