Error in fiff_write_raw_buffer: buffer and calibration sizes not matching.

Hi MNE users,

I have a raw fif file which spectrum I want to visualize in mne_analyze.
To do this, I have obtained the frequency values from the raw channels and
copied the info structure from the raw file to use them in the
fiff_start_writing_raw and fiff_write_raw_buffer commands.

When I try to save the file, I get this error:

"??? Error using ==> fiff_write_raw_buffer at 37 buffer and calibration
sizes do not match"

I think there is a problem with the info structure, especially the
triggers declaration but I do not know what it is. Channel 65 is the
stimulus channels, labeled 'STI 014'.

Below is the script I am running in matlab:

Any help is highly appreciated, thank you all!