Chaotic behaviour of solutions to a perturbed Korteweg—de Vries equation