The reason of this issue is that after the 20240727 MSYS release changed the way command line arguments are translated from the wide char.
Original reply on the MSYS Github page: https://github.com/msys2/MINGW-packages/issues/22462#issuecomment-2465927832
Patch which changes behaviour: https://github.com/mingw-w64/mingw-w64/commit/0d42217123d3aec0341b79f6d959c76e09648a1e#diff-32a4eaf3a9253a85d560f22d0c4ff81f12df6ef6977450bba36be2415dd425a3R148