Does it work if you add C:\msys64\ucrt64\bin to your PATH instead?
Again, what are your CAMLIBS and IOLIBS when you’re not in the UCRT64 terminal?
The last nightly build (4.1.0+264~g083dcb2e9) works fine for another user when these are set correctly.