The BBC has approached Amazon for comment.

According to Ofcom’s report, the tech giant said the issue was resolved in “less than 48 hours” – but during that time 122 customers had attempted to watch Diary of a Wimpy Kid.

It said it had “updated its existing internal processes” to stop similar mistakes in the future.

Ofcom has not fined Amazon for the error, however it said the firm had breached its rules.

“The complainant said they had rented the film for their young children to watch, but after the selected content began playing, the complainant became aware that the film that had actually played was a different film containing strong sexual content,” the regulator said.

“The complainant said they contacted the service provider by telephone three times but received no call back. The complainant then made their complaint to Ofcom.

“Parents and carers would have accessed Diary of a Wimpy Kid on the basis that it was appropriate for their children to view, potentially unaccompanied by an adult (as had the complainant in this case).”