Hello!
I made my account just to post this, sorry for reviving this old thread but it is my problem too. I have more than a bug report, however. I come offering insight!
Specs
Windows 10
LMMS 1.3.0-alpha.1.102+g89fc6c960
M-Audio Keystation 61 MK3 keyboard connected via USB
M-Audio SP-2 sustain pedal
The Problem
So, this problem plagued me and ruined many good recordings. It was very frustrating. As the others noted, I would hear all the music fine if I didn't record, but if I record I would get erroneous notes. I would see notes appear far in the future, in the past, and hearing the error notes almost always breaks my concentration and ruins the recording.
Once the error takes hold, every single recording will feature error notes. Turning the midi off and on in the sprocket settings didn't help. Pressing stop on every place didn't help. The only thing which fixes the problem is restarting, which is sometimes a pain for bigger files.
Now the insight
I believe I figured out what is causing this issue. You see this issue did not occur until I acquired my very first sustain pedal! I got tired of it plaguing me and tried to explore the issue to see what to avoid. I found that if you hold sustain, play notes, end the recording, and then release the foot pedal, that the error will begin to occur.
It will not occur every single time you do that, but if you do that a few times you will reliably break recording. Further, the first erroneous notes seem to occur where those notes would have been if you had released sustain first before ending record.
Now these error notes will not show up if you just let it record silent air, you must push keys for the errors to occur. In some cases after I broke it with the sustain pedal method above, it wouldn't even record all the notes. I would do a triad and it would get the 1st and 5th, but not always the 3rd and sometimes it would put the third in later (say 5 or 6 key presses later. Putting the note in the past)! Also the issue will not go away after time. Once the error takes hold it is there to stay, so it doesn't seem to just be getting rid of the uncaptured notes as the issue wont sort itself out without restart.
So if you are experiencing this problem, what I found helps limit the occurrence is ensuring your foot is not still on the sustain pedal when you stop recording. Take your foot off, then stop the recording. Doing it that way allowed me to record many times without error.
I am not sure this is the entirety of the problem, maybe holding sustain before you record also causes issues, but I am confident that my specific iteration of this issue involves the sustain pedal and hope this post gives you enough insight to fix the problem.