I was able to reproduce the issue by cloning the repo and running the script locally. After debugging, I managed to isolate the problem and find a solution.
The code fails when calling provisional_create_canister_with_cycles if no canister ID is provided. This happens because the canisterId parameter is mapped to the effectiveCanisterId through the specified_id and transform function I mentionned earlier. That’s why providing one works, and leaving it empty does not.
If I supply a canister ID (for example, the one I use by default in Juno’s Docker setup), the script runs successfully and the canister is created.