Problem solved but I don’t know how! Went for a walk and then, being a golden oldie, had a nap after lunch. Was about to conduct an experiment trying the procedure with both units switched on so that they had identical codes and then repeating with the YouView box switched off at the mains. Didn’t have to try it because it unexpectedly seems to have fixed itself before I got started. Maybe I shouldn’t crow too soon. If the problem had persisted I was going to ask if there is a way to change the code for Youview remote. A real mystery as to why it should suddenly start working properly. Thanks to all for comments.