Using mri_surf2vol - creating overlay file

I have a surface projection (vector of length 163842) that i can succefully plot with pysurfer https://pysurfer.github.io/. I initially used project_volume_data from MNI152 to surface in fsaverage. Now I would like to project this surface back to MNI152. To my understanding in order to use mni_surf2vol I need a surface file (i.e /fsaverage/surf/lh.inflated) and an overlay file (i.e a *.w file). How do I create such file? I tried using mri_covert to create .w file from a pickle of a tuple (vertex indices, values in float) but this seems to create an empty file (of size 5 bytes). I tried creating a gifti but this return mris is NULL (i also tested it on some template surface file i know is correctly made, same error). When I trie to run mri_surf2vol --so [...]/freesurfer/subjects/fsaverage/surf/lh.inflated [...]hemi-lh.w --subject fsaverage --hemi lh --regheader fsaverage --o /output/test

I get a buffer overflow error.

I’m on Ubuntu 20.04, freesurfer version freesurfer-linux-ubuntu20_x86_64-7.3.1-20220723-115e466