As Eddie Lotter said, many MIDI files often put the end of a note and the beginning of the next note at exactly the same time. If you send notes of the same pitch like this to a mechanical instrument, it won't have time to stop between the notes.
As a simple fix, you could reduce the length of all notes in a MIDI file by a small amount. For example, you could use the free Windows MIDI sequencer
Sekaiju as follows:
1. In the Edit menu, choose Select All.
2. In the Edit menu, choose Modify Event's Duration.
3. Select Relative ticks and type in a negative number.
If you only want to reduce the length of notes when it is needed (when notes of the same pitch are touching and you want to create a small gap between them), I wrote a script for Sekaiju Application Language, a $5 add-on for Sekaiju:
Player Piano Prep Script. (The script also helps in case you are converting a multi-instrument MIDI file for playback with a single instrument. If notes of the same pitch overlap, it removes the overlap.)
I'm interested if anyone knows of any other tools to add gaps between notes like this. I can't find good terms to search for it online.