Yes, it is sorted by name, but I tried when sorting by coordinate and the results are the same. Before the mapping the fastq had the same number of reads (so I suppose that there were no orphans), and if I run the RSEM without the deduplication step, the RSEM worked perfectly. Then I suppose that there is a problem with the deduplication step, that it generates some orphans. I ran the umi-tools dedup with the following parameters.
--paired --unpaired-reads=discard --chimeric-pairs=discard
So in theory it shouldn't have unpaired-reads