Hi Giuseppe,
In that case it's not necessarily an error on your part, but the duplicate is happening outside of GenomicSEM (i.e., at the univariate TWAS stage) and read_fusion is just taking that duplicate forward.
Since the issue is from the TWAS step it's harder for me to diagnose as far as why you are getting that duplicate. I imagine you are using the same set of gene expression reference weights for all your traits, so it's strange that you are getting the duplicate for only one of your traits. Possible steps forward would be to:
1. If you did any kind of data merging of the univariate TWAS output ensure that there are no errors there (e.g., did you split running the TWAS across separate runs and potentially reran one gene in the same tissue multiple times).
2. Did you create your own gene expression reference weights? If so, double check those to see why you might have a duplicate there.
3. Try rerunning the univariate TWAS for that chromosome for that trait and see if you get the duplicate again.
4. If none of these help diagnose the issue then the simplest way forward would be to delete that duplicate row for that trait prior to running read_fusion. Not the most ideal as it still doesn't tell us why the duplicate is appearing in the first place, but it's ultimately one gene out of thousands and would help you move forward with analysis.
Best,
Andrew