1 of 3

JavaScript 6, 113 Bytes

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

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

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