# JavaScript 6, 116 Bytes

    f=x=>(h=[...x].sort(_=>Math.random(z=0)-.5)).some(y=>y==x[z]||(x+x).match(y+(q=h[++z]||h[0])+'|'+q+y))?f(x):h.join``

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

    f=x=>(h=[...x].sort(_=>Math.random(z=0)-.5)).some(y=>y==x[z]||(x+x).match(y+(q=h[++z]||h[0])+'|'+q+y))?f(x):h.join``

    console.log (f('abcdef'));

<!-- end snippet -->