If your ROM is located at C:\Users\Name\Desktop\New Folder\Xiaomi ROMs\Redmi_Note_12_Global... , the tool may fail to read the scripts.
Right-click your downloaded .tgz file and extract it. This leaves you with a .tar file. mi flash error cannot find file flashalllockbat