Importing EEGlab dataset by a script

It seems, the issue is that you are performing two different actions: in the GUI you are clicking on the option Import MEG/EEG, but the shared script is for the process Create link to raw file. To have the same results as with import from the GUI, use the process Import > Import recordings > Import MEG/EEG existing epochs.