2 of 3 added 16 characters in body

JavaScript 6, 120 Bytes

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

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

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