Whenever either the "Record MIDI overdub" or "Record MIDI replace" options are used while loop recording, the length of the recorded item is longer than the loop size. It also grows sporadically on subsequent recording passes. The bug is not present when either the "Record MIDI touch-replace" or "Record MIDI latch-replace" are activated.
EDIT: it looks like the buffer size somehow affects this because the bigger it is the longer the item gets.
Here's a licecap of the bug:
.