I found a statement in the explanation of DEFI_FICHIER command description. I think this is cruicial in defining the output files. The description is as follows: "The user must declare the physical names of the files and the associated logical units. This declaration is made in the astk interface prior to launching the execution of the job. The files must be added to the study profile by selecting the libr type and associating them with the chosen logical unit number".
Once I added the names of all files together with logical units under 'Data Files' for my case study (I think this can also be added via astk interface), the script executed successfully and saved all my expected results. I am attaching herewith the mesh file, command file, and export file for someone who wants to test it. I didn't have to specify the DEFI_FICHIER command in my command file.
Now, my doubt is why we should use the "DEFI_FICHIER" command if we need to externally define the required files and their logical units.