Have noted several times the errors in Ardour's midi looping. Apparently it's finally going to be fixed:
Tue, 2018-03-27 10:24, paul: MIDI looping will be an area of intense focus for the 6.0 release. It is known to work incorrectly in all existing releases, at least in cases where note boundaries coincide with the loop boundaries (it does work in other situations).
But some people are never happy:
Thu, 2018-03-29 11:44, ccaudle: All these kids and their new fangled loopty loops. In my day we had to play a song all the way from beginning to end, and we liked it that way. :)