I tried that, and it seems to have gotten further through the process, but it still doesn't work.
It seems to extract every map to the new maps folder - attack.wad becomes ML_map01.wad, canyon.wad becomes ML_map02.wad, and so on.
It says in the console that it was extracting teeth.wad to ML_map21.wad, and after that it throws an IndexError.
I looked in the pk3 folder where everything seems to be stored before it gets put into the final pk3 file, and every ML_mapXX.wad map is there, except for the final one - ML_map21.wad does not exist in that folder.
I tried changing the filenames of each master levels map so that they were all lowercase, and that had no effect.
I also tried specifying a different order for the master levels in the command line, but that also had no effect.
Since the error was an IndexError and the line it stopped on was:
extract_map(in_wad, in_wad.maps.find('*')[1], out_wad_filename)
I tried changing the 1 to a 0, and it still gave the same error.
I've uploaded the logs, including the error as shown in the console, here: https://pastebin.com/NKy879XW