What?
On exercise of 15.3 GeneratePermutation page 230 the solution code and EPIJudge are reversing the swap in the for loop.
I managed to pass the tests without that second swap by generating this list instead:
[[0, 1, 2], [0, 2, 1], [2, 0, 1], [2, 1, 0], [0, 1, 2], [0, 2, 1]]
There must be an issue in the functions checking the list content as there are duplicated results.
How?
Delete the second swap and see all the tests passing.