# [Perl 6], 82 bytes

*-2 bytes thanks to Jo King*

<!-- language-all: lang-perl6 -->

    ->\n{([-] map {$/=[^n];:10[map {|splice $/,$_,1},[R,] .polymod(1..n-2)]},n+1,n)/9}

[Try it online!][TIO-jocsbs1n]

[Perl 6]: https://github.com/nxadm/rakudo-pkg
[TIO-jocsbs1n]: https://tio.run/##LcjfCoIwFIDxVzkXIxwd3Y7rDxb2EN2uJZIKwZxDr8T27Culmx98n29He4r9DLsOypjeHm5JdGqgrz0sTJT66cz1QlJv4zN5@361wASyCimgvqOBzA927ocmoSxzac5NQLcndFwUIU71DF3CKg7dMEKuEIgKhPPKUaqfB6nWICk3/sr4BQ "Perl 6 – Try It Online"

0-indexed. Doesn't enumerate all permutations. Should theoretically work for all n, but bails out for n > 65536 with "Too many arguments in flattening array".

The following **80 byte** version works for n up to 98!-2 and is a lot faster:

    {([-] map {$/=[^99];:10[map {|splice $/,$_,1},[R,] .polymod(1..97)]},$_+1,$_)/9}

[Try it online!][TIO-jocsd0tj]

[TIO-jocsd0tj]: https://tio.run/##NY1BDoIwFESv8hfEFC3QTxWohku4baohQhOTNjSwapCz10J0815mZjFumEwVrIeDhjYsRGYKbOdgSYpWPoRQtysyuTef2Zn3a4CkoMmT4krlnSrI3Wi8HXuCeS7qVK1xPGFEWog1zJ0HTWIAPU5QcgqIgkK94cJ45JnxLfCqbOpoZGzHj39FE3lUsJ00aVaGLw "Perl 6 – Try It Online"