Would it not have been easier to just mount the destroyed old pool or recovering the dataset from the history ring buffer?
zpool import -D
https://openzfs.github.io/openzfs-docs/man/master/8/zpool-im...
I haven't tried this, but I gather from the blog post that it would have been much simpler as it didn't require any of the encryption stuff.