It's comp record mode. SONAR leaves the most recent take active, splits all takes where the active one ends if it doesn't run the full length of the loop, and fills out the take by making the remainder of the previous one active. But it's not yet smart enough to know that the last snippet that was recorded before you could get to the Spacebar is a throwaway, so you have to throw it away yourself:
- Delete the last take lane.
- Swipe the length of the previous take with the Comp Tool cursor in the lower half of the clip to 'heal' the splits in all takes
OR
- Select the whole lane and Ctrl+click on of the take segments with the Comp Tool to heal all takes.
You can avoid the 'pre-roll' segment in the first take before the loop starts by setting an auto-punch range that matches the loop so it doesn't record anything outside the loop.
I'd suggest starting the loop a measure or two before the punch point to give yourself time to stop the transport after the last take, but I think most people would find pausing between takes screws up their flow, and isn't worth the trouble to save a little 'housekeeping'.