When running the minification pass with --minify-imports-and-exports-and-modules, the pass will fail with the following assertion:
Assertion failed: (res.second), function operator(), file MinifyImportsAndExports.cpp, line 118.
[1] 5104 abort wasm-opt opt.wasm --enable-reference-types --enable-gc --enable-bulk-memory
This appears to be because the pass does not deal well with duplicate names, even if they come from different modules. In fact, duplicate imports even with the same module and name is explicitly allowed by the WebAssembly specification.