I have one project with a strange MIDI recording behaviour that I've not encountered before...
When I've stopped recording a MIDI item (replace or overdub, makes no difference), the item, which I can see building nicely as I record, shortens and you can see the 'item end loop' indent...
On the basis that a picture paints a thousand words, here a link to an animated GIF demonstrating the problem. I can't seem to use the IMG embedding at the moment, so you'll have to click it, I'm afraid.
https://imgur.com/a/53Eo6YO
Other info:
The project has a tempo map built using the "SWS/BR: Convert project markers to tempo markers...", which I use a lot and never has this issue before.
The problem doesn't occur in a fresh project (with or without tempo markers)...
Cheers
Uncleswede