Why there is no direct moveSheet(sheet, position)
The Spreadsheet service exposes moveActiveSheet(pos), not a generic moveSheet(sheet, pos). That single word — Active — is the whole constraint. The method only moves whichever tab is currently active, so before every move you have to call setActiveSheet to tell Sheets which tab you mean. Skip that call and you will shuffle the same tab over and over.
Positions are 1-based: position 1 is the leftmost tab. The loop counter i runs from 0, so the call is moveActiveSheet(i + 1). Using i directly drops the first sheet into position 0, which the API silently clamps to 1 — and your sort comes out one step off.