I have watch history enabled and still get the loops all the time.
I even went so far to seek out a website that does it for me, and which I set up as a bookmark https://youtube-playlist-randomizer.bitbucket.io/
Altough, seems like the site is now broken